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

Today's Date

Status
Not open for further replies.

aj3221

Technical User
May 14, 2008
79
US
I have a report I run daily. I open it up, I click on Select Expert and change an "is equal to" parameter from the date there to the date I am running it. It's always today's date. For example, I open it up today and it has Friday's date. I type over that w/ today's date. Is there anyway to just have it pull "today's date" when I open it?
 
From the Report menu, choose Selection Formulas, Record.
Alter your record selection formula to use this logic:

{table.datefield} = currentdate

~Brian
 
I'm not sure what version of Crystal you have, but there is an easy way in XI. Open the record selection window and "Show Formual" and then go into the Formula editor. Then your formula should have {table.Field}= (00,00,0000) or something. change it to read:

{table.Field}= DateTime(CurrentDateTime)

If you have just a date field (no time), then

{table.Field}= Date(CurrentDate)

See if that works...
 
Your problem is that you are using the very limited Select Expert, instead of using the record selection formula that was suggested by dbreed35.

There are tons of things you can do with a record selection formula that you cannot do with the select expert.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
I went into Record Selection and put in my field then the = Date{CurrentDate} but got this box that says "A date-time is required here.". This field is a string and appears MM/DD/YY. Maybe I have to do something else first to the string? Convert it to a date?
 
If it is a string on the database side, then you will need to convert the currentdate field to a string:

{table.date} = ToText(currentdate,"MM/dd/yyyy")

~Brian
 
Where are you placing this formula? It should be under Report|Selection Formulas|Record.

~Brian
 
This is what I did: because me order date is a string I used your formula and created my own ORD DTE:
{ORDER_HEADER_A.ORDER_DATE} = ToText(currentdate,"MM/dd/yyyy")

Then I went into Report|Selection Formulas|Record and

{@ORD DTE} = currentdate

Now I get a boolean is required here when I tried to accept it
 
You shouldn't be putting in it's own formula.
Just put this directly in the record selection formula:

{ORDER_HEADER_A.ORDER_DATE} = ToText(currentdate,"MM/dd/yyyy")

~Brian
 
Genius! I was totally making that much harder than it was. Thank you so much! Sorry for being a pain!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top