Results 1 to 5 of 5
  1. #1
    venu_resoju is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    19

    DateSerial Format

    Hai Friends..



    I am trying to form a Format of DateSerial function, but I am unable to get succeed.

    I want the format for the first day of the month in the following structure:
    01-Jan-2013
    &
    the last day of the last month(not current month) in the following structure : 31-Dce-2012

    Please help me for the above

    Thanking you.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    First of the current month
    Code:
    DateSerial(Year(Date()),Month(Date()),1)
    #1/1/2013#


    Last day of last month
    Code:
    DateSerial(Year(Date), Month(Date), 0)
    #12/31/2012#


    To change the way it is displayed =>> Format(#1/1/2013#,"dd-mmm-yyyy")
    returns 01-Jan-2013

    Format(#12/31/2012#,"dd-mmm-yyyy")
    returns 31-Dec-2012

    That is the best I can do - you didn't provide VBA code or query (SQL) or say how you want to use DateSerial() or Format() functions.

  3. #3
    venu_resoju is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    19
    Thank you ssanfu,

    I am trying like below for a text box...

    =Formate([DateSerial(Year(Now), Month(Now), 1)], "DD-MMM-YYYY")


    &
    =Formate([DateSerial(Year(Now), Month(Now), 0)], "DD-MMM-YYYY")

    but I didn't get

    thanking you

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    =Formate([DateSerial(Year(Now), Month(Now), 1)], "DD-MMM-YYYY")
    Format does not have a "E".


    Code:
    =Format(DateSerial(Year(Date), Month(Date), 0),"dd-mmm-yyyy")

  5. #5
    venu_resoju is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    19
    THANK YOU ssanfu....

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

Similar Threads

  1. Replies: 5
    Last Post: 12-17-2012, 11:54 AM
  2. Replies: 2
    Last Post: 08-07-2012, 02:02 PM
  3. Number Format to General Format
    By mkc80 in forum Access
    Replies: 2
    Last Post: 05-05-2012, 02:10 AM
  4. Replies: 3
    Last Post: 03-05-2012, 04:06 PM
  5. format
    By nkuebelbeck in forum Queries
    Replies: 1
    Last Post: 03-23-2010, 10:22 AM

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