Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default ODBC MS Query - comparing dates

Having trouble with SQL statement

table= loans
field_name=pay_date

I want to say WHERE loans.pay_date < TODAY I tried today(), sysdate,
CurrentDate nothing seems to work. Any help is appreciated.

Joe
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default ODBC MS Query - comparing dates

What database?
In Firebird and Interbase for example you can do:
WHERE loans.pay_date < 'TODAY'

RBS


"JoeF" wrote in message
...
Having trouble with SQL statement

table= loans
field_name=pay_date

I want to say WHERE loans.pay_date < TODAY I tried today(), sysdate,
CurrentDate nothing seems to work. Any help is appreciated.

Joe


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default ODBC MS Query - comparing dates

Superbase. In Superbase I can use TODAY and it works fine. Problem is when I
insert SQL statement in MS Query I get various errors.
I tried yours and got the following error msg "Ivalid operand for operator:
<" Other messages include - "Expected Lexical element not found..", "Column
not found..." etc...

Thanks.

"RB Smissaert" wrote:

What database?
In Firebird and Interbase for example you can do:
WHERE loans.pay_date < 'TODAY'

RBS


"JoeF" wrote in message
...
Having trouble with SQL statement

table= loans
field_name=pay_date

I want to say WHERE loans.pay_date < TODAY I tried today(), sysdate,
CurrentDate nothing seems to work. Any help is appreciated.

Joe



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default ODBC MS Query - comparing dates

I don't know Superbase, but maybe you can do this:

WHERE loans.pay_date < (select TODAY from loans)

The other option is to use a variable and put the current date in that in
the right format, so you will get something like this:

"SELECT * FROM loans WHERE loans.pay_date < " & strCurrentDate


RBS



"JoeF" wrote in message
...
Superbase. In Superbase I can use TODAY and it works fine. Problem is
when I
insert SQL statement in MS Query I get various errors.
I tried yours and got the following error msg "Ivalid operand for
operator:
<" Other messages include - "Expected Lexical element not found..",
"Column
not found..." etc...

Thanks.

"RB Smissaert" wrote:

What database?
In Firebird and Interbase for example you can do:
WHERE loans.pay_date < 'TODAY'

RBS


"JoeF" wrote in message
...
Having trouble with SQL statement

table= loans
field_name=pay_date

I want to say WHERE loans.pay_date < TODAY I tried today(), sysdate,
CurrentDate nothing seems to work. Any help is appreciated.

Joe




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default ODBC MS Query - comparing dates

Try:

WHERE loans.pay_date < GETDATE()
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
ODBC Query Laddie Excel Worksheet Functions 0 April 23rd 10 03:35 PM
ODBC query problem Arvi Laanemets Excel Discussion (Misc queries) 3 September 26th 08 02:03 PM
ODBC database query gneissgirl Excel Discussion (Misc queries) 0 November 10th 05 06:18 PM
Problem with .Background Query option of ODBC Query Shilps Excel Programming 0 April 19th 04 06:41 AM
SQL query to ODBC gkelle[_5_] Excel Programming 2 February 12th 04 01:34 PM


All times are GMT +1. The time now is 07:14 AM.

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

About Us

"It's about Microsoft Excel"