PC Review


Reply
Thread Tools Rate Thread

Date problem in a SELECT sql statement

 
 
=?Utf-8?B?Q2hyaXN0aW5h?=
Guest
Posts: n/a
 
      5th Mar 2007
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 With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      5th Mar 2007
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" <(E-Mail Removed)> wrote in message
news:308F69D1-4299-4FC3-A072-(E-Mail Removed)...
> 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 With Quote
 
=?Utf-8?B?Q2hyaXN0aW5h?=
Guest
Posts: n/a
 
      5th Mar 2007
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" <(E-Mail Removed)> wrote in message
> news:308F69D1-4299-4FC3-A072-(E-Mail Removed)...
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date variable doesn't retain its value in select case statement? Andy B Microsoft ASP .NET 1 24th Jan 2009 11:57 AM
Re: What is the problem with my SELECT statement ? Michel Walsh Microsoft Access Queries 3 13th Dec 2005 05:08 PM
Problem with SELECT Statement =?Utf-8?B?SSBhbSBTYW0=?= Microsoft ASP .NET 1 4th Mar 2005 07:45 PM
Date Select statement not working from 01/10/2004 =?Utf-8?B?SGVsZ2FyZA==?= Microsoft Access VBA Modules 3 1st Oct 2004 02:17 PM
SQL Select statement with Date as Pepe Microsoft Excel Programming 3 4th Feb 2004 06:50 PM


Features
 

Advertising
 

Newsgroups
 


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