SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select "datetime" rows
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

hapetter
Starting Member

10 Posts

Posted - 06/17/2013 :  04:27:25  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 06/17/2013 :  04:30:32  Show Profile  Reply with Quote
whats the datatype of [DateTime] field?

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

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 06/17/2013 :  06:33:11  Show Profile  Reply with Quote
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 - 06/17/2013 :  07:21:01  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 06/17/2013 :  09:14:29  Show Profile  Reply with Quote
Ok...tht sounds sensible


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000