FrankPorter
asked on
case statement reserve word
hi,
Please assist how can we use the case statement with the correct syntax, i've been having problems with reserve word?
strRequest = "Select timevalue(datetime) as [DateTime], " & _
" [case when 0=0 then 1 end] as [aaa] " & _
" From [Mytable$] " & _
" group by timevalue(datetime);"
error returned "no value given for one or more required parameter."
Thanks.
Please assist how can we use the case statement with the correct syntax, i've been having problems with reserve word?
strRequest = "Select timevalue(datetime) as [DateTime], " & _
" [case when 0=0 then 1 end] as [aaa] " & _
" From [Mytable$] " & _
" group by timevalue(datetime);"
error returned "no value given for one or more required parameter."
Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
cquinn,
It was for demonstration.
It was for demonstration.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mrdany,
vb returned:
error returned "no value given for one or more required parameter."
vb returned:
error returned "no value given for one or more required parameter."
well i need the field names... my fields were fictional... here's a good sql:
select case when parentcategory=category then 'main category' else 'sub category' end as categorytype,
category, parentcategory from categories group by category, parentcategory
can u give me ur sql, i can see what's wrong with it??
cheers
select case when parentcategory=category then 'main category' else 'sub category' end as categorytype,
category, parentcategory from categories group by category, parentcategory
can u give me ur sql, i can see what's wrong with it??
cheers
ASKER
this is the actual sql, i tried using the most basic. I'm using Ms Excel as database and VB as interface.
strRequest = "Select " & _
" [case when 0=0 then 1 end] as [aaa] " & _
" From [Mytable$] ; "
.Open strRequest
strRequest = "Select " & _
" [case when 0=0 then 1 end] as [aaa] " & _
" From [Mytable$] ; "
.Open strRequest
i didnt get it.. does it work or not??
i tried it here, it's not working... i'm looking nito it..
i tried it here, it's not working... i'm looking nito it..
ASKER