0

I am selecting the max value of a column from a table. If the table does not have any rows i need the result as zero. how can i achieve this

Regards

Vivek

3
Contributors
6
Replies
7
Views
5 Years
Discussion Span
Last Post by Reverend Jim
0
Select ISNULL(MAX(serial_no),0) from temp_mr

error : Wrong number of arguments used with function in query expression 'ISNULL(MAX(serial_no),0)'.

0

Which DB ur using?
this syntax Select ISNULL(MAX(Column),'0') from Table Where ur condition is working good for me..in SQL

0

Which DB ur using?
this syntax Select ISNULL(MAX(Column),'0') from Table Where ur condition is working good for me..in SQL

I am using Access...

0

I don't know if COALESCE is available under Access (but it is under SQL). It takes a variable number of arguments and returns the first value that is non NULL. If you call it like COALESCE(MAX(Column),0) it may give you what you want (again, assuming it is supported under Access).

This topic has been dead for over six months. 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.