Question : What's wrong with this SQL?

What's wrong with this line of SQL (using within VB.Net)?

SQLQuery = "select ISNULL(InvDate, '-') from " & tabletosearch & " where Serial = '" & txtReturn_Serial.Text & "'"

Basically, what I am trying to do is look at the Invoice Date in a table (tabletosearch, which is a variable of which the value is generated elsewhere),  The problem comes when the Invoice Date is NULL.  It works fine where is an actual value.  I don't see what's wrong with the SQL.  Help!  Thanks ;)

Answer : What's wrong with this SQL?

'-' is not a date. you might try this:
1:
2:
SQLQuery = "select ISNULL(CONVERT(varchar(10), InvDate, 120), '-') from " & tabletosearch & " where Serial = '" & txtReturn_Serial.Text & "'"
Random Solutions  
 
programming4us programming4us