Link to home
Start Free TrialLog in
Avatar of BananaFury
BananaFury

asked on

Min Date of a column that contains NULLS

Hello

I would like to return the Min Date of a column that contains NULLS, which means the Min Date is always a NULL. I cannot remove these records from the record set.
I thought about a formula field that said something "if date is NULL then 01/01/2999 (a date miles in the future)" then running a MIN down this formula field but that seemed like an odd way of tackling the problem.

What is the correct solution to this problem?

Thanks
Avatar of ste5an
ste5an
Flag of Germany image

Change the data source. Use COALESCE() to set an appropriate minimum value.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BananaFury
BananaFury

ASKER

Thanks mlmcc, using a CurrentDate as a default is an obviously better idea than my massive future date, but not one that I had thought of actually. The report is bolted onto a stored procedure, running from some tables in a SQL DB so I could tweak the source, but I don't really want to do that. What is a Crystal COMMAND though? Never heard of that.

Thought about the sub reports idea, and passing out the value via a variable, but I have half a dozen or so formulas like this to create, so didn't really fancy that many subs all with there own link to a table, seemed a little data hungry.

The running totals is something I hadn't thought about either. That would be a slightly painful solution for me as I believe I would need to move everything to footers to use RT's.

thanks all
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, I went with the CurrentDate solution.

The Crystal Commands are interesting, never seen or used these before. I can imagine using these at some point

thanks all