Results 1 to 3 of 3
  1. #1
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528

    Date Serial function

    Hello guys


    How do I make my month field in the function of each month the year and not the current month?
    Code:
    DateSerial(Year(Now()),Month(1-2-3-4-5-6-7-8-9-10-11-12)-1,Day(1))

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Sorry azhur not sure what you mean. Can you give an example of what the input would be and what the function would give out?


    Sent from my iPhone using Tapatalk

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    ?? I agree more clarity in the requirement is needed, or an example.

    Sub testazh()
    Dim i As Integer 'i represents month 1-12
    For i = 1 To 12
    Debug.Print DateSerial(year(Date), i, 1)
    Next i
    End Sub

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

Similar Threads

  1. Replies: 3
    Last Post: 07-07-2015, 12:29 PM
  2. Replies: 7
    Last Post: 02-25-2014, 03:11 PM
  3. Replies: 1
    Last Post: 10-25-2013, 03:38 PM
  4. Replies: 1
    Last Post: 09-06-2011, 05:24 AM
  5. Replies: 5
    Last Post: 02-08-2006, 08:42 PM

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