| Author |
Topic |
|
JaybeeSQL
Posting Yak Master
112 Posts |
Posted - 2012-07-24 : 05:58:27
|
| Select top 100 *, FirstArchivalDateFrom tblCOMStudy with (nolock)Where FirstArchivalDate between '2012-07-10' and '2012-07-23'Order by FirstArchivalDateThis only yields records for the 10th July, yet if I change it to the 11th, I'll get records with the archival date of the 11th!Any ideas? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
JaybeeSQL
Posting Yak Master
112 Posts |
Posted - 2012-07-24 : 06:22:05
|
| Incorrect syntax near '>'. |
 |
|
|
JaybeeSQL
Posting Yak Master
112 Posts |
Posted - 2012-07-24 : 06:26:39
|
| Also tried Where FirstArchivalDate > '20120710' and FirstArchivalDate <'20120724'Where FirstArchivalDate between '20120710' and '20120724'Same results, nothing beyond the 10th (but there are definitely records) |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-07-24 : 06:42:10
|
| What is the datatype of FirstArchivalDate? Also remove top 100 and see if you get all recordsMadhivananFailing to plan is Planning to fail |
 |
|
|
JaybeeSQL
Posting Yak Master
112 Posts |
Posted - 2012-07-24 : 06:43:02
|
| Here's a sample of the date value... 2012-07-10 10:28:43.683 |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-07-24 : 06:59:40
|
| Read my previous replyMadhivananFailing to plan is Planning to fail |
 |
|
|
JaybeeSQL
Posting Yak Master
112 Posts |
Posted - 2012-07-24 : 07:12:50
|
| Datetime, Null |
 |
|
|
JaybeeSQL
Posting Yak Master
112 Posts |
Posted - 2012-07-24 : 07:15:21
|
| Removing the top 100 did it with "between '20120710' and '20120724' "... Thanks!! ) |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-07-24 : 07:18:54
|
| But don't use between, use thisWhere FirstArchivalDate between >='20120710' and FirstArchivalDate <'20120724'MadhivananFailing to plan is Planning to fail |
 |
|
|
JaybeeSQL
Posting Yak Master
112 Posts |
Posted - 2012-07-24 : 08:37:12
|
| Will do - but also, is there a way to group them according to day? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-07-24 : 08:41:58
|
typo error therequote: Originally posted by madhivanan But don't use between, use thisWhere FirstArchivalDate between >='20120710' and FirstArchivalDate <'20120724'MadhivananFailing to plan is Planning to fail
KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-07-24 : 08:48:44
|
quote: Originally posted by khtan typo error therequote: Originally posted by madhivanan But don't use between, use thisWhere FirstArchivalDate between >='20120710' and FirstArchivalDate <'20120724'MadhivananFailing to plan is Planning to fail
KH[spoiler]Time is always against us[/spoiler]
Yes thanks MadhivananFailing to plan is Planning to fail |
 |
|
|
|