About
Pricing
Community
Teams
Start Free Trial
Log in
donnie91910
asked on
1/2/2013
Query Date/Time field
I need to query a table where I am looking at a time stamp. The time stamp that i will be looking for will be for the month of January 2013.
The dates in the time stamp will be formatted like this (Date/Time):
1/1/2013 2:00:00 PM
1/3/2013 4:00:00 PM
1/17/2013 8:00:00 PM
How do I query this field so that I only get the month of January and the year of 2013.
Thanks.
SQL
13
6
Last Comment
PortletPaul
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Pratima
1/2/2013
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Pratima
1/2/2013
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Pratima
1/2/2013
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Pratima
1/2/2013
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
donnie91910
1/2/2013
ASKER
Microsoft Access 2003 database .
SOLUTION
Pratima
1/2/2013
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
IrogSinta
1/2/2013
How about:
Select Format(date_col, "mmmm yyyy")
That will give you January 2013
mmm will give you Jan
mm will give you 01
donnie91910
1/2/2013
ASKER
There are other dates also:
1/1/2013 2:00:00 PM
1/3/2013 4:00:00 PM
1/17/2013 8:00:00 PM
2/11/2009 4:00:00 PM
4/21/2010 6:00:00 PM
6/21/2005 1:00:00 PM
I only want to query for the January 2013 dates.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Pratima
1/2/2013
you mean to say you want all sates for JAn 2013 , does not want formatting
try this
Select date_col from tablename
where Month(date_col) = 1 and Year(date_col) = 2013
santoshsahoo123
1/2/2013
select * from table where Month ( coloumn name ) =01 and year (coloumn name) =2013
Check and update if it s working.
SOLUTION
IrogSinta
1/2/2013
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
jaiminpsoni
1/3/2013
select to_char(<date_col>, 'mm/dd/yyyy hh:mi:ss AM') from <NameOfTable> where to_char(<date_col>, 'mmyyyy') = '012013';
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
PortletPaul
2/1/2013
[[date-field] between [low-date] and [high-date]
see:
http://www.youtube.com/wat
ch?v=TFXzG
dTSfTg
note, generally in sql: "between ... and ..." is the equivalent of:
[date-field] >= [low-date] and [date-field] <= [high-date]