0

I have a Database that stores a residentID, apartment, MoveInDate, and MoveOutDate.
I am trying to run a query from this database to find the resident row where the MoveOutDate is NULL so I can enter the date they moved out. My Coldfusion is not the best and here is what I have been trying to do with no avail.

<cfquery datasource="residents" name="getrentals">
SELECT * 
FROM apartmentrentals 
WHERE ID = #URL.recordID# AND MoveOutDate = 'NULL"
</cfquery>

Can someone help me out with the correct syntax.

Thanks

Edited by mijorog: n/a

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by arrgh
1

This has nothing to do with CF. It is a pure SQL question ;)

AND MoveOutDate = 'NULL'

NULL isn't a string. It is a special system value. You can't use equals "=" either. To find nulls you must use

WHERE  ColumnName IS NULL

Edited by arrgh: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.