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

Pull Date from Field 1

Status
Not open for further replies.

Cozmo2

Technical User
Apr 7, 2006
87
US
I have Crystal 9.
I have a string parameter field that contains school year. 200910 represents the 2009 & 2010 school year. I want to create two formula fields (must be datetime fields) from this parameter. I defined one as:
dateTimeVar PgmStart:= CDate(val(Left({?Interest Year},4)),08,01) + Ctime(00.00,00, 00); Works OK.
The second one (that I can't get to work) looks like this:
dateTimeVar PgmEnd:= CDate((Left({?Interest Year},2), Right({?Interest Year},2)),05, 15) + Ctime(00.00,00, 00);

Any and all help is appreciated.
 
You left off the "val":

dateTimeVar PgmStart:= CDate(val(Left({?Interest Year},2)+mid({?Interest Year},5,2)),05,15) + Ctime(00.00,00, 00);

You could probably simplify these a bit:

datetime(left({?Interest Year},4) + ",8,1")

datetime(left({?Interest Year},2) + mid({?Interest Year},5,2) + ",5,15")

 
Thank you briangriffin, it works perfectly!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top