Tuesday, March 27, 2012

Cant get CAST function to work in ASP.NET

I'm trying to do something like this SQL statement. I have a table with a field of date/times.

i.e - 2/27/06 9:55:95 PM Basically there are multiple entries in the table per day.

I want to count the records for particular (hence the CAST) and output the count.

Here it was I had just to see if SQL would work in ASP.NET :

SELECT COUNT(*) AS Expr1
FROM dbo.tblActiveDrums
WHERE [CAST](FLOOR([CAST](NCTimeStamp AS [float])) AS datetime) = '0' OR
NCTimeStamp - [CAST](FLOOR([CAST](NCTimeStamp AS [float])) AS datetime) = '0'

It didn't like the AS references?

Any help would be appreciated.

Remove all the brackets and post if there are any error messages. Shouldn't be.|||You want to count the records for a particular what?

No comments:

Post a Comment