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
How to send 'F1' key as ASCII character?
Backup of MS Windows Operating systems
Import feature in Pl/Sql Developer
calculate timespan after midnight
How do I block netbios traffic using Windows Server 2008 firewall
How to delete all relationships between tables before deleting tables within Access using VBA?
Replace pc4200 with pc6400
WAMP will not restart on WINDOWS 2003 Server
asp error in code - values
Unmerge cell and split into rows