Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Date problem in a SELECT sql statement

Hi everyone,

I have a problem that I cannot figure out , please help me.
I have a colum J that contain the date such as 25/9/2005 0:00:00 (those date
come from a select in my Access database). Then, I want to use those date in
another select as follow:
SQL.REQUEST(Conx,,4,"Select mesure from piezo where no_site like '" & $M$14
& "' and date_piezo = DATEVALUE(" & J23 & ")")
As I know, this SELECT must return the mesure value, However it does not
return any value.

Any help will be appreciated
Regards,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Date problem in a SELECT sql statement

Christina,
Check the actual string that you are sending. It looks as if it is something
like:
Select mesure from piezo where no_site like 'Some Value' and date_piezo =
DATEVALUE(39073)

whereas I guess you need something like:
"Select mesure from piezo where no_site like '" & $M$14 & "' and date_piezo
= " & DATEVALUE( J23 )

Also are the field names spelt correctly ?

NickHK

"Christina" wrote in message
...
Hi everyone,

I have a problem that I cannot figure out , please help me.
I have a colum J that contain the date such as 25/9/2005 0:00:00 (those

date
come from a select in my Access database). Then, I want to use those date

in
another select as follow:
SQL.REQUEST(Conx,,4,"Select mesure from piezo where no_site like '" &

$M$14
& "' and date_piezo = DATEVALUE(" & J23 & ")")
As I know, this SELECT must return the mesure value, However it does not
return any value.

Any help will be appreciated
Regards,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Date problem in a SELECT sql statement

Hi Nick,

Thank for your help. I follow your way and it works correctly. Thanks
again....

Regards,
Christina

"NickHK" wrote:

Christina,
Check the actual string that you are sending. It looks as if it is something
like:
Select mesure from piezo where no_site like 'Some Value' and date_piezo =
DATEVALUE(39073)

whereas I guess you need something like:
"Select mesure from piezo where no_site like '" & $M$14 & "' and date_piezo
= " & DATEVALUE( J23 )

Also are the field names spelt correctly ?

NickHK

"Christina" wrote in message
...
Hi everyone,

I have a problem that I cannot figure out , please help me.
I have a colum J that contain the date such as 25/9/2005 0:00:00 (those

date
come from a select in my Access database). Then, I want to use those date

in
another select as follow:
SQL.REQUEST(Conx,,4,"Select mesure from piezo where no_site like '" &

$M$14
& "' and date_piezo = DATEVALUE(" & J23 & ")")
As I know, this SELECT must return the mesure value, However it does not
return any value.

Any help will be appreciated
Regards,




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
Select Case Statement Katie Excel Worksheet Functions 13 December 1st 08 07:32 PM
How can I modify the SELECT statement? wliong[_11_] Excel Programming 5 March 8th 06 04:09 PM
SELECT statement Tom Ogilvy Excel Programming 2 July 23rd 04 06:24 PM
SQL Select statement with Date as Pepe[_2_] Excel Programming 3 February 4th 04 06:50 PM


All times are GMT +1. The time now is 10:40 AM.

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"