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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select "datetime" rows

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.5

I 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!



Regards
Hans

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-17 : 04:30:32
whats the datatype of [DateTime] field?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

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 typo
SELECT * FROM eTable WHERE [DateTime] < $"DbData.sTimeStamp[0]$''


--
Chandu
Go to Top of Page

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.

Regards
Hans
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-17 : 09:14:29
Ok...tht sounds sensible


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -