Results 1 to 2 of 2
  1. #1
    vibinmvenugopal is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    4

    Please help me to change quarter to date


    I have one excel sheet which contain values in quarter like 2013 - Qtr 3, 2012 - Qtr 4 etc..

    I am linking this excel sheet to access and in access I want to change this into dates, eg : 2013 - Qtr 3 should be shown as 07/01/2013 etc.

    Please help.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Because of the odd return, you will need a function in a new cell to import the correct date.
    usage: =CvtQtr2Date(A1)

    Code:
    Public Function CvtQtr2Date(ByVal pvQtrTxt)
    Dim Q As Integer
    Dim M, Y
    Y = Left(pvQtrTxt, 4)
    Q = Mid(pvQtrTxt, InStr(pvQtrTxt, ",") - 1, 1)
    Select Case Q
       Case 1
          M = 1
       Case 2
          M = 4
       Case 3
          M = 7
       Case 4
          M = 10
    End Select
    CvtQtr2Date = M & "/1/" & Y
    End Function

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

Similar Threads

  1. Replies: 2
    Last Post: 07-15-2014, 12:00 PM
  2. Replies: 4
    Last Post: 01-09-2013, 11:16 AM
  3. Replies: 25
    Last Post: 11-16-2012, 12:47 PM
  4. Display previous quarter data when quarter is selected
    By rlsublime in forum Programming
    Replies: 1
    Last Post: 07-03-2012, 03:12 PM
  5. Sum bookings by quarter
    By kgav1 in forum Access
    Replies: 3
    Last Post: 04-14-2010, 08:15 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