Quarter and Year out of Date

  • Thread starter Thread starter PR
  • Start date Start date
P

PR

I have a field caller ATR Start Date which is #dd/mm/yyyy# format, I want to
get the following out of the date:

Which year.
What Quarter in that year.

Can anyone help

Paul R
 
Year([StartDate])

Format([StartDate], "q")

--
John Viescas, author
"Building Microsoft Access Applications" (Coming Soon!)
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
DatePart("yyyy",[ATR Start Date])
DatePart("q",[ATR Start Date])
Year([ATR Start Date])
Format([ATR Start Date],"yyyy")
Format([ATR Start Date],"q")
 
Can I have this?
DatePart("q","yyyy",[ATR Start Date])

Paul


Duane Hookom said:
DatePart("yyyy",[ATR Start Date])
DatePart("q",[ATR Start Date])
Year([ATR Start Date])
Format([ATR Start Date],"yyyy")
Format([ATR Start Date],"q")
--
Duane Hookom
MS Access MVP
--

PR said:
I have a field caller ATR Start Date which is #dd/mm/yyyy# format, I want
to get the following out of the date:

Which year.
What Quarter in that year.

Can anyone help

Paul R
 
No, you can't. DatePart only takes a single interval argument.

You can, however, have DatePart("q", [ATR Start Date]) & " " &
DatePart("yyyy", [ATR Start Date]) or Format([ATR Start Date], "q yyyy")



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



PR said:
Can I have this?
DatePart("q","yyyy",[ATR Start Date])

Paul


Duane Hookom said:
DatePart("yyyy",[ATR Start Date])
DatePart("q",[ATR Start Date])
Year([ATR Start Date])
Format([ATR Start Date],"yyyy")
Format([ATR Start Date],"q")
--
Duane Hookom
MS Access MVP
--

PR said:
I have a field caller ATR Start Date which is #dd/mm/yyyy# format, I want
to get the following out of the date:

Which year.
What Quarter in that year.

Can anyone help

Paul R
 
PR,
Wouldn't it have made sense to
1) try the syntax before asking
2) check Access Help on the functions suggested

I (and others) don't mind answering questions but you need to learn to be a
least a little resourceful on your own.

--
Duane Hookom
MS Access MVP
--

PR said:
Can I have this?
DatePart("q","yyyy",[ATR Start Date])

Paul


Duane Hookom said:
DatePart("yyyy",[ATR Start Date])
DatePart("q",[ATR Start Date])
Year([ATR Start Date])
Format([ATR Start Date],"yyyy")
Format([ATR Start Date],"q")
--
Duane Hookom
MS Access MVP
--

PR said:
I have a field caller ATR Start Date which is #dd/mm/yyyy# format, I want
to get the following out of the date:

Which year.
What Quarter in that year.

Can anyone help

Paul R
 
Back
Top