I have to query a from a table something like the following but its not working ???
select invoice,right(isnull(code,'XXXXXXXX'),2) from invoice where invoicedate='2008-01-04' .
The code field is NULL in most of the results...
HI,
i think the problem is with the invoice date. probably it has the timestamp along with it and not comparing with the date give
so find the date diff to compare the dates as follows
select invoice,right(isnull(code,'XXXXXXXX'),2) from invoice where DATEDIFF(DD,invoicedate,'2008-01-04') = 0
hope will work
thanks