Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to extract data through ODBC with date criteria?

There is a table in the database with separate fields Month and Year
as integers. How to use SQL to retrieve records after a specified
date? I have tried a number of date functions e.g. DateSerial but SQL
doesn't like it. How should I specify that condition?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default How to extract data through ODBC with date criteria?

Let's say you want records from dates after March 2002;
you could try this:

SELECT * FROM MY_TABLE WHERE (YEAR 2002) OR (YEAR=2002
and MONTH3)

Just substitute in the proper parameters to allow
selection of any month and year.

-----Original Message-----
There is a table in the database with separate fields

Month and Year
as integers. How to use SQL to retrieve records after a

specified
date? I have tried a number of date functions e.g.

DateSerial but SQL
doesn't like it. How should I specify that condition?
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to extract data through ODBC with date criteria?

Thanks.
I was thinking of converting the Month and Year to a date and then use
any date comparison method.
Yours is simple enough.


On Fri, 21 Nov 2003 06:37:05 -0800, "Ken Dales"
wrote:

Let's say you want records from dates after March 2002;
you could try this:

SELECT * FROM MY_TABLE WHERE (YEAR 2002) OR (YEAR=2002
and MONTH3)

Just substitute in the proper parameters to allow
selection of any month and year.

-----Original Message-----
There is a table in the database with separate fields

Month and Year
as integers. How to use SQL to retrieve records after a

specified
date? I have tried a number of date functions e.g.

DateSerial but SQL
doesn't like it. How should I specify that condition?
.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default How to extract data through ODBC with date criteria?

Sometimes simple is best, but our minds get used to
thinking too concretely: it's a date, so I have to use
date functions!

-----Original Message-----
Thanks.
I was thinking of converting the Month and Year to a date

and then use
any date comparison method.
Yours is simple enough.


On Fri, 21 Nov 2003 06:37:05 -0800, "Ken Dales"
wrote:

Let's say you want records from dates after March 2002;
you could try this:

SELECT * FROM MY_TABLE WHERE (YEAR 2002) OR (YEAR=2002
and MONTH3)

Just substitute in the proper parameters to allow
selection of any month and year.

-----Original Message-----
There is a table in the database with separate fields

Month and Year
as integers. How to use SQL to retrieve records after a

specified
date? I have tried a number of date functions e.g.

DateSerial but SQL
doesn't like it. How should I specify that condition?
.


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
extract data from a date range Detin8 Excel Discussion (Misc queries) 2 March 29th 10 05:09 AM
criteria to filter and extract row data into separate worksheet karenc Excel Worksheet Functions 1 December 16th 08 03:25 AM
Extract data on one spreadsheet to another based on criteria AndyJ New Users to Excel 5 January 4th 08 12:43 AM
extract data from table that meets set criteria Aaron Excel Discussion (Misc queries) 1 August 18th 06 05:33 PM
how to extract data based on date vidhya Excel Worksheet Functions 1 October 18th 05 10:39 AM


All times are GMT +1. The time now is 12:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"