Microsoft
Software
Hardware
Network
Question : NULL in T-SQL
I need to check if a value (PXProjectID) is NULL for filtering in the where clause of the select statement of the cursor. Unfortunately I can't fetch a NULL value in the variable @PXProjectID what is a int value. I also tried to declare the varialble as sql_variant. How can I filter the cursor without need to set a variable for the PXProjectID Field?
Declare CurProj Cursor
Global
Scroll
Dynamic
Scroll_Locks
For
Select ProjectID, CustomerID, MiteProjectID, Name, Budget, Archived, CreatedOn, PXProjectID
From dbo.AX_Project
Where Archived = 0 and isNULL(PXProjectID,'null')
= 'null' --Only Projects where are not archieved and where are no PXProjectID
Open CurProj
Fetch next from CurProj into @ProjectID, @CustomerID, @MiteProjectID,
@Name, @Budget, @Archived, @CreatedOn, @PXProjectID
While @@FETCH_STATUS = 0
Begin
Answer : NULL in T-SQL
Hi Opusretis,
try something like isNULL(PXProjectID,-999) =-999
Gary
Random Solutions
Vista Home: Use of NET.TCP terminates w3wp.exe and listener
Basic MS Access Line Chart in report
How to read field names from an XSD file.
ranking records and determining percentage of total in access 2007
Infinite loop when Range is only 1 cell
outlook 2000 "TCP/IP connection was unexpectedly terminated by your mail server. If this problem persists, contact your LAN
MS Access Macro Auto Select Both Combo Box and Text Box at Same time in Same form
Data table with offsheet input
MS ACCESS CODE PROBLEM - Can't assign a value to this object
Subreport/ Subform not showing up in Main Report