Re: Quarterly Data Syntax
- From: "Russell Fields" <russellfields@xxxxxxxxxx>
- Date: Mon, 22 Oct 2007 13:27:38 -0400
Ryan,
To get the quarter, assuming January to March is the first quarter"
select (datepart(Month,MyDateColumn) + 2) / 3
This depends on how integer match works. Or you can create a calendar table
(Google for that) to record this kind of information for every date.
RLF
"Ryan Mcbee" <RyanMcbee@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DEE46F58-A938-463E-964F-D2756E906986@xxxxxxxxxxxxxxxx
I am trying to build a query that will return what quarter the data is in.
How would I begin to build this logic? In my table, all I have is a
single
date of the transactions. My date column looks like this; "2014-02-01
00:00:00.000".
Thanks in advance,
Ryan
.
- Prev by Date: Re: indexes and selects
- Next by Date: Re: Pulling data that could be in one of 2 tables
- Previous by thread: Re: indexes and selects
- Next by thread: Re: Pulling data that could be in one of 2 tables
- Index(es):
Relevant Pages
|
|