Link to home
Start Free TrialLog in
Avatar of FrankPorter
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.
SOLUTION
Avatar of rettiseert
rettiseert

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
Avatar of FrankPorter
FrankPorter

ASKER

msexcel
SOLUTION
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
cquinn,

It was for demonstration.
ASKER CERTIFIED SOLUTION
Avatar of Dany Balian
Dany Balian
Flag of Lebanon 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
mrdany,

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
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
i didnt get it.. does it work or not??

i tried it here, it's not working... i'm looking nito it..