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 |
hapetter
Starting Member
10 Posts |
Posted - 2013-06-17 : 04:27:25
|
Hi.I have a table with a column of date time tags.I use SQL server compact v3.5I like to check how many rows in the table before a specified date. I tride different approaches without success.This is my query string:SELECT * FROM eTable WHERE [DateTime] < $'DbData.sTimeStamp[0]$''It reports back that < is not allowed with this format (datetime). So how to do this?Thanks! RegardsHans |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-17 : 04:30:32
|
whats the datatype of [DateTime] field?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-06-17 : 06:33:11
|
SELECT * FROM eTable WHERE [DateTime] < $'DbData.sTimeStamp[0]$"--May be that was a typoSELECT * FROM eTable WHERE [DateTime] < $"DbData.sTimeStamp[0]$''--Chandu |
|
|
hapetter
Starting Member
10 Posts |
Posted - 2013-06-17 : 07:21:01
|
Thanks.I found the problem to be the way I get the content of the variable. I needed to use CONCAT() function. This has nothing to do with SQL server, but its in the program I use to communicate with the server..Anyway, thanks for your inputs.RegardsHans |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-17 : 09:14:29
|
Ok...tht sounds sensible------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|