Working with Dates/Timestamps have always been a challenge for me within SQL and based on the threads many others as well.
I've been troubleshooting a problem query that's not meshing with a Crystal report. Just for kicks I displayed the query within Crystal and was surprised at the way Crystal developed the date range test. I've included a code snipet and wondered if anyone is familiar with the syntax of the where clause. I've never seen this before and it appears very easy to manage. If anyone can point me to some documentation that would be great. While I'm willing to take things on faith I'd like to understand how this functionality works.
select * from salesorder SO
inner join salesorderitems SOI on SO.salesorderid = SOI.salesorderid
where So."ORDERDATE" >= {d '2006-08-04'} AND
SO."ORDERDATE" <= {ts '2006-08-04 23:59:59.000'}
order by SOI.Product desc
Go forth and date test!
I've been troubleshooting a problem query that's not meshing with a Crystal report. Just for kicks I displayed the query within Crystal and was surprised at the way Crystal developed the date range test. I've included a code snipet and wondered if anyone is familiar with the syntax of the where clause. I've never seen this before and it appears very easy to manage. If anyone can point me to some documentation that would be great. While I'm willing to take things on faith I'd like to understand how this functionality works.
select * from salesorder SO
inner join salesorderitems SOI on SO.salesorderid = SOI.salesorderid
where So."ORDERDATE" >= {d '2006-08-04'} AND
SO."ORDERDATE" <= {ts '2006-08-04 23:59:59.000'}
order by SOI.Product desc
Go forth and date test!