Date Parameter

rowfei
rowfei used Ask the Experts™
on
What formula can I add to the date field, so end user can either select data via the calendar or the shortcut key such as T-1, M-1 etc???

Thanks in advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I appreciate this might just be me, but I have no idea what Crystal feature you are referring to by..
"the shortcut key such as T-1, M-1 etc"
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
There is no way to do that.  Crystal date prompts expect a date to be entered.  There are no shortcut keys to choose a date.

If you have CR2008 you can have optional prompts.  You could use a date for 1 and a string for another then evaluate appropriately.

I assume T-1 is yesterday and M-1 is last month

mlmcc

Author

Commented:
Yes, I do have CR2008. Do you have any sample for using the string?
Announcing the Winners!

The results are in for the 15th Annual Expert Awards! Congratulations to the winners, and thank you to everyone who participated in the nominations. We are so grateful for the valuable contributions experts make on a daily basis. Click to read more about this year’s recipients!

Do you just want to use those specific strings, "T-1" and "M-1"?  If so, what do they mean?

 Or do you want to allow something more general, like "T-X", where "X" could be different numbers?  If so, exactly what do you want to allow?

 Producing yesterday's date when a parameter is "T-1" is easy.  Actually checking the value after the "-" and producing a date based on that is more complicated.

 James

Author

Commented:
I would like to have:

T-"num" = today's day - num of days user enter.
T+"Num" = today's day + num of days user enter.

M-"num" = Current Month - num of month user enter.
M+"Num" = Current Month + num of month user enter.

Y-"num" = Current year - num of year user enter.
Y+"Num" = Current year + num of year user enter.

Also user should able enter what ever day they want on the beginning date and ending date field. Or select the date from the default calendar.

Thanks
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
As stated above, the only way to get the calendar is to use a DATE or DATETIME parameter.  It will only accept valid dates.

You can add a second parameter as a string and they can enter whatever they want.

I will try to get an example put together.

mlmcc

Author

Commented:
An example will be great. Thank you so much!!!
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial