PDA

View Full Version : Date part



torgerjl
11-14-2008, 12:33 PM
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.

Demosthine
11-14-2008, 06:03 PM
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