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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Query returning blank results

Author  Topic 

myxiplx
Starting Member

6 Posts

Posted - 2001-09-11 : 02:49:27
Hi,

I'm getting some really strange results returning date fields from my server.

It seems that as soon as I access one of these types of field, any further values from that record turn up blank. Once I move to the next record, I can return data fine, until I return a date value, at which point, I start getting blank values.

I'm running SQL 2000, and a sample SQL statement would be:
"SELECT Subject, Content, DIS_Posts.UserID, ValidFrom, Username FROM DIS_Posts, USR_Users WHERE DIS_Posts.UserID = USR_Users.UserID AND BoardID = '1' AND ValidTo IS NULL ORDER BY ValidFrom;"

UserID and BoardID are of type int,
ValidFrom is a smalldate field,
Subject and username are nvarchar,
Content is ntext

Normally, I would query the database in the order: Subject, Content, ValidFrom, Username, UserID.

Having done some testing, if I read the date first, Subject will display okay, but neither Content nor username return values. If I try to read the date after the Content, I don't get a value returned for the date!

Please help, I'm sure I'm missing something obvious, but can't find anything to tell me what's going on.

Ross

   

- Advertisement -