Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Select Case Statement | Excel Worksheet Functions | |||
How can I modify the SELECT statement? | Excel Programming | |||
SELECT statement | Excel Programming | |||
SQL Select statement with Date as | Excel Programming |