Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Quarterly Data Syntax

 
   Database Forums (Home) -> MSEQ RSS
Next:  Using CASE statement in CONTAINS predicate ( For ..  
Author Message
Ryan Mcbee

External


Since: May 17, 2007
Posts: 9



(Msg. 1) Posted: Mon Oct 22, 2007 7:36 am
Post subject: Quarterly Data Syntax
Archived from groups: microsoft>public>sqlserver>mseq (more info?)

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

 >> Stay informed about: Quarterly Data Syntax 
Back to top
Login to vote
Russell Fields

External


Since: Feb 21, 2007
Posts: 457



(Msg. 2) Posted: Mon Oct 22, 2007 1:27 pm
Post subject: Re: Quarterly Data Syntax [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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" wrote in message

>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

 >> Stay informed about: Quarterly Data Syntax 
Back to top
Login to vote
Ryan Mcbee

External


Since: May 17, 2007
Posts: 9



(Msg. 3) Posted: Tue Oct 23, 2007 8:18 am
Post subject: Re: Quarterly Data Syntax [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Russell,
Thanks, this helps out a lot. I have been trying to figure this one out for
a while.

Ryan

"Russell Fields" wrote:

> 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" wrote in message
>
> >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
>
>
>
 >> Stay informed about: Quarterly Data Syntax 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Join syntax? - I'm not sure if this is a join problem or even if it can be done. The english part of the query will be requesting cagegoires="Cat2" and return the matching records in table1, plus return all the other categories that belong to the set in ta...

Get user syntax - I am building a view for a report and one of the requirements is to grab the user who is running the report. What would this syntax look like? I thought it was getuser(), but no luck there. Thanks, Ryan

SQL Syntax Question - I have the following syntax: "select itemnmbr, locncode, (qtyonhnd-atyalloc) as "QTY Available Main" from iv00102 " The results look like; Itemnmbr locncode qty available main 121 944-16 ...

Query syntax help - I am trying to write a query that returns all suppliers within a given range that either do not have any insurance (appear only in Suppliers table) or Suppliers where the insurance has expired from a given date Eg 4 Suppliers Supplier1 - no insurance....

Syntax for query to another SQL-Server-Instance - Hi, what is the correct syntax to execute a query to a table on another SQL-Server-Instance. For example: dbo.table on Server1 with Instance2 (Server1\Instance2) Thanks in advance F. L.
   Database Forums (Home) -> MSEQ All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]