Consulting

Results 1 to 2 of 2

Thread: Date part

  1. #1
    VBAX Regular
    Joined
    Aug 2008
    Location
    Houston
    Posts
    16
    Location

    Date part

    Can someone tell me how to do a date part for this...

    If{CLOSED_PROJECTS.REQUEST_ID} IN [33963,34067...] then
    Date(2008, 09, 30)
    Else
    {CLOSED_PROJECTS.COMPLETION_DATE} <-- this field is in a mm/dd/yyyy format

    So would it be:
    ...
    else datepart("mm","yyyy"{CLOSED_PROJECTS.COMPLETION_DATE})

    - I need to have a mm/yyyy format.
    Last edited by torgerjl; 11-14-2008 at 01:53 PM.

  2. #2
    Good Evening.

    There are two methods to do this. The first is directly through your SQL Statement when you select the data. This will create a new Field named [CompletionShortDate] .

    SELECT * Format([Closed_Projects].[Completion_Date]) AS [CompletionShortDate]
    FROM [[Closed_Projects];

    Alternately, you can use the same Format Function within your code.
    Else
    Value = Format([Closed_Projects].[Completion_Date], "mm/yyyy")
    End If

    Hope this helps.
    Scott
    You don't understand anything until you learn it more than one way. ~Marvin Minsky

    I never teach my pupils; I only attempt to provide the conditions in which they can learn. - Albert Einstein

Posting Permissions

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