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

Convert formula from 24 hrs to month to date

Status
Not open for further replies.

rico7937

IS-IT--Management
Feb 20, 2001
33
US
I am using crystal reports v10 and need to try to convert this formula from showing the past 24 hrs to a month to date formula ( showing from 00:00:01 on the 1st of the month thru 23:59:59 on the last day of the month). Can someone help me out ?


DTSToDateTime(tzcvtConvToLocalDatetimeByName(ToText(DateTime({PROBLEM.OPEN_DATE},{PROBLEM.OPEN_TIME}),"MM/dd/yyyy hh:mm tt"),"Eastern Standard Time"))
In DateTime (totext (Date(DateAdd ("d",-1,Cdate(year(CurrentDate),month(CurrentDate),day(currentdate))))) & " 00:00:01")
To DateTime (totext (Date(DateAdd ("d",-1,Cdate(year(CurrentDate),month(CurrentDate),day(currentdate))))) & " 23:59:59")
 
Will this always be for the current month or will this be looking at past or future months?

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

"What version of URGENT!!! are you using?
 
This will always be for the current month
 
Time should not enter into this at all right? You just want all records in the current month?

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

"What version of URGENT!!! are you using?
 
That can be a true statement. I just need to pull in all records form the 1st of the month to the end. This report will run daily 7 days a week and that is why I am trying to use the Month to date statement. If there's a btter way please let me know. Thanks !
 
Why not use:

{YourField} in MonthtoDate

This would not work for future dates, so if something is post dated, but still in March 08, it will not show on the report.

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

"What version of URGENT!!! are you using?
 
That is what I am trying to do with this formula in the record selection:

DTSToDateTime(tzcvtConvToLocalDatetimeByName(ToText(DateTime({PROBLEM.OPEN_DATE},{PROBLEM.OPEN_TIME}),"MM/dd/yyyy hh:mm tt"),"Eastern Standard Time"))
In DateTime (totext (Date(DateAdd ("d",-1,Cdate(year(CurrentDate),month(CurrentDate),day(currentdate))))) & " 00:00:01")
To DateTime (totext (Date(DateAdd ("d",-1,Cdate(year(CurrentDate),month(CurrentDate),day(currentdate))))) & " 23:59:59")

The problem is that the tickets come out in Grennich time and I need to convert them over to Eastertn Standadrd time, I am getting the correct data it's just the time is not changing over to EST. Any suggestions ?
 
As dgillz states:

DTSToDateTime(tzcvtConvToLocalDatetimeByName(ToText(DateTime({PROBLEM.OPEN_DATE},{PROBLEM.OPEN_TIME}),"MM/dd/yyyy hh:mm tt"),"Eastern Standard Time"))
In MonthToDate

Would do for your current needs.

'J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top