Help with Timestamp Problem
Great tip. Thanks!
I'm relatively new to SQL Server (a year or so), although I've worked for several years
on Oracle databases, so this whole discussion thread has yielded several gold nuggets.
One thing that I've found to cause a lot of misunderstanding for people querying the database
in our company is the fact that if only a date is specified, the time defaults to 12:00 A.M. (Midnight).
Of course, meaning that if I just use '2007-09-14' I won't get any data except records with a timestamp of
2007-09-14 00:00:00.000 and not from midnight on, which is what they actually wanted. Most don't know this
and I often get a complaint that data isn't correct when the problem was the exclusion of the time in
the date format. To get the full day's data they would need to use something like:
between '2007-09-14 00:00:00' and '2007-09-14 23:59:59'
Is there any way around that? We have hundreds of people using various databases and I have no idea who
they all are, so educating the populace is not a real option.