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

Convert Variable Datetime to a fix DateTime

Status
Not open for further replies.

fredong

IS-IT--Management
Sep 19, 2001
332
US
I am using CR v 8.0 and I trying to use a formula to convert Variable DateTime to a fix DateTime on the ModDate field depend on the ShipCarrier field in the Detail section.The ModDate is a variable DateTime and the FixDateTime has to be the same date as the ModDateTime except the time has to be fixed .Below is the table example:

ModDateTime ShipCarrier --->convertto FixDateTime
------ ----------- -------
04/22/05 10:22am DHL 04/22/05 9:00pm
04/25/05 3:22pm DHL 04/25/05 9:00pm
04/30/05 11:45am DHL 04/30/05 9:00pm
05/03/05 10:22am FEDEX 05/03/05 7:30pm
05/08/05 3:22pm FEDEX 05/08/05 7:30pm
05/11/05 11:45am FEDEX 05/11/05 7:30pm

Please advise.Thanks.


 
Hi,
What is the business rule that determines the fixed time component?




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I guess what you're saying is that depending upon a carrier, you're going to adjust the time portion of a date called moddate and display it as fixdate:

If {table.carrier} = "DHL" then
cdatetime(year(moddate),month(moddate),day(moddate),9,0,0)
else
If {table.carrier} = "FEDEX" then
cdatetime(year(moddate),month(moddate),day(moddate),7,30,0)
else
... you get the idea

-k
 
Thanks a lot for your help it works very well for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top