Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-07-08 : 11:58:56
|
| Imtiaz writes "OK this problem has had me confused for two days now. And I can't take it any more. Here is the problemThis is how my query looks like:select field1,field2,datefield1from view1where datefield1 between '06/01/2004' and '06/27/2004'order by datefield1 descThe results don't show anything exisiting on the 06/27/2004 date.Whereas when i run this query:select field1,field2,datefield1from view1order by datefield1 descIt shows me 4 records which have datefield1=06/27/2004 Any ideas wats going on??I would really appreciate your help. Thanking you,Imtiaz" |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-07-08 : 12:38:40
|
Usewhere datefield1 >= '06/01/2004' and datefield1 < '06/27/2004' instead.Note also that your date format is not "safe". SQL may interpret '01/02/2004' as dd/mm/yyyy or mm/dd/yyyy.Kristen |
 |
|
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2004-07-08 : 14:28:38
|
I think you meantwhere datefield1 >= '06/01/2004' and datefield1 < '06/28/2004' |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-07-08 : 14:33:34
|
| You're quite right Arnold, thanks. I was going to amke an excuse for the time over here, and the glass in my hand, but you're in the same boat!Kristen |
 |
|
|
imtiazmt
Starting Member
1 Post |
Posted - 2004-07-10 : 04:38:12
|
| thanks ppl.. this works |
 |
|
|
|
|
|