Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2012
    Posts
    6

    Unanswered: Complex date format in a report

    This has been a big pain. I have a report that I need an unusually complex date format in. I have the code written to produce what I want locally, now I'm trying to modify it for our satelite offices around the world. I've written out what I have, what it's supposed to do and what it does. This is what I have.....

    This Code in the report,
    =Format$([tblCCM.date_reqstd],"dd") & Format$([tblCCM.time_reqstd],"hhnn") & [tblSMCC_Data.SMCC_Tzone] & UCase(Format$([tblCCM.date_reqstd],"mmmyyyy")) & " (" & Format$([tblCCM.date_reqstd],"dd") & (Format$([tblCCM.time_reqstd],"hhnn")+700) & "Z" & UCase(Format$([tblCCM.date_reqstd],"mmmyyyy")) & ")"

    Produces this
    291000TFEB2012 (291700ZFEB2012)

    Day, Time, Local Time Zone, Month, Year (Day, Time, GMT Time Zone, Month, Year)

    The following expressions are built into a query in the report
    GMT: IIf([tblSMCC_data].[SMCC_Tzone]="T","700")
    If Local Time Zone = T then [GMT] is 7 hours difference

    DST: IIf([dylt]=1 And [tblSMCC_data].[SMCC_DST]=True,[GMT]-100,[GMT])
    If the date is between the Daylight Savings Time Dates and you participate in DST then [DST] is 1 hour less than [GMT] Else [GMT]

    This Code in the report,
    =Format$([tblCCM.date_reqstd],"dd") & Format$([tblCCM.time_reqstd],"hhnn") & [tblSMCC_Data.SMCC_Tzone] & UCase(Format$([tblCCM.date_reqstd],"mmmyyyy")) & " (" & Format$([tblCCM.date_reqstd],"dd") & (Format$([tblCCM.time_reqstd],"hhnn")+[DST]) & "Z" & UCase(Format$([tblCCM.date_reqstd],"mmmyyyy")) & ")"

    Produces this
    291000TFEB2012 (291000700ZFEB2012) This (291000700ZFEB2012) is wrong it should read like above
    Day, Time, Local Time Zone, Month, Year (Day, Time+[DMT], GMT Time Zone, Month, Year)

    Help :-)

  2. #2
    Join Date
    Feb 2012
    Posts
    6
    I figured it out. I added a CInt infront of the [DST]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •