Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

SQL Query modified to include a date range instead of a single date.

$
0
0

How should this be written to include the date range 2013-08-01 to 2013-09-06?

This is a SQL query to access chat logs in MS OCS.

SELECT date, u1.useruri as [from], body, u2.useruri as [to] from messages, users u1, users u2 
where (messages.fromid = u1.userid and messages.toid = u2.userid)
and CONVERT(CHAR(10),date,120) = '2013-08-01'

order by date


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>