Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

isnull, max date

Status
Not open for further replies.

sandeep0000

Programmer
May 10, 2007
98
US
i have a end_date field, i need to get all nulls and max end date,

i was told i need to do something like this

isnull(max(end_dt),getdate


but i get an error

im using sql server
 
i dont think i explained it very good the first time

basically if the end_dt is null then i want it, if not i want the max (end_dt)
 
Hi,

I pressuming that you're having trouble with your SQL ode for a query you're olanning to use in a Reporting Services Report.

This will give you the value of end_dt if NOT Null, and the MAX(end_dt) if it IS Null.

Code:
ISNULL(end_dt, MAX(end_dt))

This will give you the value of end_dt if NOT Null or the current system date if it IS Null.

Code:
ISNULL(end_dt, GETDATE())

Apologies but both your posts are a little unclear.

Cheers,
Leigh

"If you had one shot, one opportunity, to seize everything you ever wanted, in one moment, would you capture it, or let it slip" - Eminem

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top