Results 1 to 7 of 7
  1. #1
    DurkeeM is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    3

    Getting rid of the (p) stamp in a report.


    I am driving myself insane trying to figure out how to get the start date inside of a report to stop having the (p) stamp at the end of it.

    How it's displaying:"Digital Camera Basics," 7(p)-9p.m.Tuesdays, Sep. 8-29. Fee: $89.

    How I want it to display: "Digital Camera Basics," 7-9p.m.Tuesdays, Sep. 8-29. Fee: $89.

    So far I've changed the start time to "Short Time" and I've been trying to decode the mile long Iif expression, but I've been facing some difficulties.I've pasted it below in case the answer is staring me right in the face.

    =Chr(34) & [CourseTitle] & "," & Chr(34) & " " & (IIf(((((Format([StartTime],"Short Time")>="12:00")) And ((Format([EndTime],"Short Time")>="12:00"))) Or (((Format([StartTime],"Short Time")<"12:00")) And ((Format([EndTime],"Short Time")<"12:00")))),IIf((Format([StartTime],"nn")>0),(Format([StartTime],"h:nn”)),(Format([StartTime],"h "))) & Chr(45) & IIf((Format([EndTime],"nn")>0),(Format([EndTime],"h:nn a/p") & ".m."),(Format([EndTime],"ha/p") & ".m.")),IIf((Format([StartTime],"nn")>0),(Format([StartTime],"h:nn ")),(Format([StartTime],"h”)) & Chr(45) & IIf((Format([EndTime],"nn")>0),(Format([EndTime],"h:nna/p") & ".m."),(Format([EndTime],"ha/p") & ".m.")))) & IIf([StartDate]=[EndDate],Format([StartDate],"dddd"", ""mmm"". ""d"),IIf([StartDate]<>[EndDate] And Format([StartDate],"mmm")=Format([EndDate],"mmm"),Format([StartDate],"dddd""s, ""mmm"". ""d") & Chr(45) & Format([EndDate],"d"),IIf([StartDate]<>[EndDate] And Format([StartDate],"mmm")<>Format([EndDate],"mmm"),Format([StartDate],"dddd""s, ""mmm"". ""d") & Chr(45) & Format([EndDate],"mmm"". ""d"),""))) & ". Fee: $" & [ClassFee] & "."

    Any help is extremely welcome!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    format([date],"hh")

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    really can't work out exactly what you require

    are the options?
    9-10am
    5-6pm
    11am-2pm

    and if so why not
    9am-10am
    etc?


    e.g. format(starttime,"ham/pm") & "-" & format(endtime,"ham/pm")

  4. #4
    DurkeeM is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    3
    Where in the expression would I slip this into?

  5. #5
    DurkeeM is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    3
    The report needs to be generated in a specific way to meet the criteria of who we're sending it to. So the only option for listing time is 7-9:30p.m. and not 7p.m.-9p.m.

  6. #6
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    OK so you are back to your iif statement.

    Before I spend more time on this, please clarify what are all are the options regarding the times that could be displayed

    9-10a.m.
    5-6p.m.
    11a.m.-2p.m.

    are these all of them? if no what others are there?

    are any of the above not relevant (e.g. you don't have appointments spanning midday)

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    I copy/pasted the IIf expression into Notepad++. It shows the first ( in front of the first IIf() is unmatched. It also shows the ( that follows is unmatched. Lots of unnecessary () pairs.

    Notepad++ is a free download.

    I did a Replace operation on the expression in VBA. 63 '(' were replaced but only 62 ')'. So it seems there is not only an extra ( but also a misplaced ( or ).

    Consider this simpler format:

    Format([StartDate],"dddd\s, mmm. d")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to create a User Stamp
    By boxsta in forum Access
    Replies: 3
    Last Post: 05-22-2012, 02:46 PM
  2. Date Stamp when a field is changed
    By winterh in forum Access
    Replies: 1
    Last Post: 04-25-2012, 07:27 AM
  3. Adding a Time Stamp to a Form
    By Tomlon in forum Forms
    Replies: 2
    Last Post: 02-03-2012, 08:45 AM
  4. Date and Time Stamp
    By zoooza84 in forum Access
    Replies: 2
    Last Post: 08-06-2011, 04:53 AM
  5. Append Query: Time Stamp
    By AKQTS in forum Programming
    Replies: 3
    Last Post: 08-16-2010, 12:34 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums