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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTime or 9/9/999 Current Date error

Status
Not open for further replies.

WTKnow

Programmer
Aug 3, 2006
29
US
Hello everyone!
I have DateTime field in my query.
I am fromatting it to a dd/mm/yyyy in Crystal.
Ths field is a parameter.
I need to set it up so it shows current date on first pop up.
I am setting default as 9/9/9999.
I am inserting parameted {?CurrentDate}.
In Selection Formula I insert {t.field}>{?CurrentDate}
Report runs fine. Except sometimes I am getting third party software error message that 'Default parameter 9/9/9999 is invalid' I can click this message out and continue to run Report successfully but it doesn't look good for the users.

I am thinking maybe there is a better way dealing with DateTime datatype or better set up then 9/9/9999?

Please, advise.
Thanks
 
One solution is to use two parameters, one saying the type of selection and the other specifying a date when there is one.

THen create a selection formula, @GoodDate,
Code:
 (SelectParam = "C" 
 and 
 {your.date} = currentdate)
or
  {your.date} = ParamDate

First display by unselected details - @GoodDate should return True or False, a Boolian value

In your selection, just say @GoodDate, meaning records will be selected when the value is True

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Madawc,
what is SelectParam = "C"
What does it represent? thanks
 
If you're using a 3rd party product, then it's the 3rd party, I would change the default date to 1/1/1970 or some such.

-k
 
I want default to be Today's date (Current) every day they open up the report.
But in Crystal I have to set Default. How can I set Current Date default in Crystal insted of 9/9/9999?

Thanks
 
SelectParam is the name I was using for the extra parameter that you could add. Make it a string parameter, C for current or O for other, but only C need be tested for. Set C as a default value.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top