Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2003
    Location
    UK
    Posts
    85

    Question Unanswered: A simple date display question

    Dear All

    Please have a look at the following statement in control source of a test box

    ="Q" & [ReferenceNo] & -Format(Date()," yy")


    If [ReferenceNo] = 25

    The output I get is

    Q25-5

    How can I make it to show

    Q25-05

    Please advice

    Thank you

  2. #2
    Join Date
    Feb 2005
    Location
    England.
    Posts
    232
    Why don't you try this??

    - Right$(Year(Now()), 2)

    Hope it helps.

  3. #3
    Join Date
    Mar 2003
    Location
    UK
    Posts
    85
    Thanks for your reply

    Not working as required

    still produces

    Q25-5

    Any more suggestions

  4. #4
    Join Date
    Feb 2005
    Location
    England.
    Posts
    232
    Ok, how about this then??

    Dim strDate as string

    strDate = Right$(Year(Now()), 2)

    ="Q" & [ReferenceNo] & "-" & strDate

    If this doesn't work, may I suggest you look at your time/date setting and just check what format your short date is in.

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    alternatively

    ="Q" & [ReferenceNo] & "-" & format(year(Date(),"00"))

  6. #6
    Join Date
    Mar 2003
    Location
    UK
    Posts
    85

    Thumbs up

    I have treid Daveo61's solution and it is working perfectly well.

    Thank you for your help

Posting Permissions

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