Query comparing dates in SQL

0 votes

I have a table containing dates for events that all occurred in November. I created this query:

select id,numbers_from,created_date,amount_numbers,SMS_text 
from Test_Table
where 
created_date <= '2013-04-12'

Because it occurred before the date "2013-04-12," this query should return everything that occurred in month 11 (November) (in December) But it only displays accessible dates for events that occurred on days earlier than 04 (2013-04-12)

Maybe it's simply comparing the day portion. not the entire date? How can I fix this?

Sep 12 in Database by Kithuzzz
• 12,240 points
36 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Database

0 votes
0 answers

Comparing Dates in Oracle SQL

I'm attempting to get it to show ...READ MORE

Aug 9 in Database by Kithuzzz
• 12,240 points
132 views
0 votes
0 answers

How do I query for all dates greater than a certain date in SQL Server?

I tried this: SELECT * FROM dbo.March2010 A WHERE ...READ MORE

Aug 29 in Database by Kithuzzz
• 12,240 points
37 views
0 votes
1 answer

SQL Server replaces LEFT JOIN for LEFT OUTER JOIN in view query

You are getting the joins confused and ...READ MORE

answered Feb 4 in Database by Neha
• 8,920 points
186 views
0 votes
1 answer

Inserting multiple rows in a single SQL query?

In SQL Server 2008, multiple rows can ...READ MORE

answered Feb 10 in Database by Vaani
• 7,020 points
91 views
0 votes
1 answer

SQL query to find third highest salary in company

The easiest way to work this out ...READ MORE

answered Feb 21 in Database by Neha
• 8,920 points
7,156 views
0 votes
0 answers

How can I show the table structure in SQL Server query?

Query: SELECT DateTime, Skill, Name, TimeZone, ID, User, ...READ MORE

Aug 11 in Database by Kithuzzz
• 12,240 points
71 views
0 votes
1 answer

Difference between datetime and timestamp in sqlserver?

Timestamp is a synonym for rowversion, according ...READ MORE

answered Feb 16 in Database by Vaani
• 7,020 points
1,250 views
0 votes
1 answer

How to convert DateTime to VarChar

With Microsoft Sql Server: -- -- Create test case -- DECLARE ...READ MORE

answered Feb 23 in Database by Neha
• 8,920 points
73 views
0 votes
0 answers

Get week day name from a given month, day and year individually in SQL Server

I'm attempting to get a day name ...READ MORE

Aug 13 in Database by Kithuzzz
• 12,240 points
63 views
0 votes
1 answer

Calculate Time Intersection to Correlate Sequences of Independent Events

I think this solution requires a CROSS JOIN implementation. ...READ MORE

answered Oct 26, 2018 in Power BI by Upasana
• 8,620 points
330 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP