Link to home
Start Free TrialLog in
Avatar of Kourosh Barati
Kourosh BaratiFlag for United States of America

asked on

Classic ASP date query question

Hi,

I have a query to display simple information on an classic ASP page. What I need is the part it filters the "emp_term_date" to be greater than today's date. I want the system to automatically grab today's date and replace the '6/11/2015' in the query. Here is my query:

Select
  informix.sfu_localdirect_rec.id,
  informix.sfu_localdirect_rec.staff,
  informix.sfu_localdirect_rec.stu,
  Trim(informix.sfu_localdirect_rec.fullname) As fullname,
  Trim(informix.sfu_localdirect_rec.email) As email,
  Trim(informix.sfu_localdirect_rec.lname) As lname,
  Trim(informix.sfu_localdirect_rec.fname) As fname,
  informix.sfu_localdirect_rec.rec_type,
  informix.sfu_localdirect_rec.emp_term_date
From
  informix.sfu_localdirect_rec
Where
  (informix.sfu_localdirect_rec.rec_type <> 'P' And
  informix.sfu_localdirect_rec.emp_term_date Is Null) Or
  (informix.sfu_localdirect_rec.emp_term_date > '1/11/2015'   )
Order By
  lname
Avatar of Big Monty
Big Monty
Flag of United States of America image

use the getdate() function:

Select
  informix.sfu_localdirect_rec.id,
  informix.sfu_localdirect_rec.staff,
  informix.sfu_localdirect_rec.stu,
  Trim(informix.sfu_localdirect_rec.fullname) As fullname,
  Trim(informix.sfu_localdirect_rec.email) As email,
  Trim(informix.sfu_localdirect_rec.lname) As lname,
  Trim(informix.sfu_localdirect_rec.fname) As fname,
  informix.sfu_localdirect_rec.rec_type,
  informix.sfu_localdirect_rec.emp_term_date
From
  informix.sfu_localdirect_rec
Where
  (informix.sfu_localdirect_rec.rec_type <> 'P' And
  informix.sfu_localdirect_rec.emp_term_date Is Null) Or
  (informix.sfu_localdirect_rec.emp_term_date > getdate()   )
Order By
  lname
Avatar of Kourosh Barati

ASKER

I am using informix odbc connection and using that function it gives me "routine getdate() can not be resolved.
ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If I use '6/11/2015' then it works. It seems converting date to string might work?
Current worked well. Thanks
glad to help :)