Microsoft
Software
Hardware
Network
Question : sql query between dates
Hi There,
I have a quick question in sql date range queries.
I have two dates:
'07/01/2010' and '07/06/2010'
I am using the below query.
select t1.column1, t2.column1 from table t1, table t2 where t1.column3 = t2.column3 and t1.dateRange >='7/1/2010' and t2.daterange < '7/6/2010'
I am not getting the results. There is data in the table.
any clues?
Thanks!
Answer : sql query between dates
use
convert(datetime, '23/10/2016', 103)
to convert your parameters to date then compare with your table columns... like:
t1.dateRange >= convert(datetime, '23/10/2016', 103)
Random Solutions
Copying Cells that contain a Range name......
Windows 7 - BSOD
Windows 2003 Server Remote Sites not Replicating with main location
Getting bounce back messages when sending to internal domain users after moving to SBS 2008
Managing systems in a trusted domain from a single EPO server
How can I trigger a macro when the "send to mail" function is used?
Getting this warning in the system log "An error was detected on device \Device\Harddisk0 during a paging operation."
vb.net XML edit in form..
sql syntax help in my vba code when primary key field has spaces
(Simple) Creating array, appending and recreating.