What am I doing wrong? Need a special date format...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fspinelli
    New Member
    • Aug 2010
    • 85

    What am I doing wrong? Need a special date format...

    Greetings!

    NE2: [un] & ([Expiration]"mmm") & [st] & [op] & ([Expiration]"yyyy")

    That's what I have in a query column. I need it to look like this:

    SPXAUG775C2009

    The SPX is [un]
    The 775 is [st]
    The C is [op]

    I had commas after the [Expiration] both times just before I put the format I wanted it in, but there was a syntax error.

    Can anyone give me a hint??

    Thank you and have a wonderful weekend.

    Faith
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    Try: Format([Expiration],"mmm")

    Nic;o)

    Comment

    • Fspinelli
      New Member
      • Aug 2010
      • 85

      #3
      Yea! Wooo! Thank you!

      Ok, now how do I make them upercase?

      [un] & format([Expiration],"mmm") & [st] & [op] & format([Expiration],"yyyy")

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        Use the Ucase() function.

        Nic;o)

        Comment

        • Fspinelli
          New Member
          • Aug 2010
          • 85

          #5
          well, that's what I'm not sure how to put in this string.

          I don't know how to enter it in the code.

          Thanks, Nico!

          Comment

          • MMcCarthy
            Recognized Expert MVP
            • Aug 2006
            • 14387

            #6
            Hi Faith

            You have to use a function to change the format. In this case I think the format() function will do what you require.

            So try this...

            NE2: [un] & Format([Expiration],"mmm") & [st] & [op] & Format([Expiration],"yyyy")

            Comment

            • MMcCarthy
              Recognized Expert MVP
              • Aug 2006
              • 14387

              #7
              LOL! that's what I get for keeping threads open in tabs. Nicely done Nico :)

              Comment

              • nico5038
                Recognized Expert Specialist
                • Nov 2006
                • 3080

                #8
                Know the problem Mary ;-)

                @Fspinelli
                Try:
                Code:
                Ucase([un] & format([Expiration],"mmm") & [st] & [op] & format([Expiration],"yyyy") )
                Nic;o)

                Comment

                • Fspinelli
                  New Member
                  • Aug 2010
                  • 85

                  #9
                  Thank you both!

                  I see what I was doing wrong, I had the Ucase before the word "format"...

                  I greatly appreciate your help, Mary and Nico!

                  It's working out great now and I look like a hero!(wink wink)

                  Comment

                  • nico5038
                    Recognized Expert Specialist
                    • Nov 2006
                    • 3080

                    #10
                    Glad we could help, success with the application !

                    Nic;o)

                    Comment

                    • Fspinelli
                      New Member
                      • Aug 2010
                      • 85

                      #11
                      Can I push some more?

                      I added a commond button "Add Record"...so after whoever enters the info, they press it and it gives a fresh screen to enter a new record. I would like for the tab stop to start at a particular field after Add Record clicked.

                      Do I add code to the New Record code or do I have to do something else?

                      I really appreciate this!

                      Can you tell I'm new at this?

                      Comment

                      • nico5038
                        Recognized Expert Specialist
                        • Nov 2006
                        • 3080

                        #12
                        Always best to post a new answer for a new item.
                        This is however very short, just right-click the top left square of the form (where the rulers meet) and select the tab-order option. Move the needed field to the top.

                        Nic;o)

                        Comment

                        Working...