all groups > sql server msde > december 2005 >
You're in the

sql server msde

group:

SQL Server 2005 Express SQL problem


SQL Server 2005 Express SQL problem Andrew Chalk
12/27/2005 7:57:46 PM
sql server msde:
In SQL Server 2005 Express the follwoing query produces the wrong result:

SELECT CHANNEL, DURATION, STARTTIME
FROM Recordings
WHERE (STARTTIME > '12/27/05 00:00:00') AND (DURATION > '5')
ORDER BY STARTTIME DESC

If I replace it with:
SELECT CHANNEL, DURATION, STARTTIME
FROM Recordings
WHERE (STARTTIME > '12/27/05 00:00:00')
ORDER BY STARTTIME DESC

I can see records that should be in the first resultset but are not. I.e.
the AND (DURATION > '5')
clause messes up the result.

The exact same query worked in SQL Server 2000. Presumably some SQL syntax
option is different in SQL Server 2005 Express. Does anyone have any idea
how to restate the first expression to correctly account for the DURATION
clause?

Many thanks.

Re: SQL Server 2005 Express SQL problem Trey Walpole
12/27/2005 11:19:11 PM
is duration a character column or numeric of some sort?
please post ddl for better answers

[quoted text, click to view]
Re: SQL Server 2005 Express SQL problem Andrew Chalk
12/28/2005 5:44:22 AM
My fault. I was sent bad data. The duration field was zero. Duh!

- A

[quoted text, click to view]

AddThis Social Bookmark Button