Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with PostgreSQL Query
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Help with PostgreSQL Query
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01429771
Message ID:
01429771
Views:
97
Dear all
I am trying to execute the following query in postgresql, but keep getting errors ("error near group by"). Tried to run it in pgadmin's query tool, and got different errors ( like IIF not recognized ). Can anyone help me "translate" the sql from vfp to postgre?
Table name in postgre: weblog
Fields: agent C(4), function varchar(20), xmlstr text
lcStr = [select weblog.agent, ]+;
[sum(iif(weblog.function="GetCars" or "GETCARS"$weblog.xmlstr,1,0)) as RateRequests,]+;
[sum(iif(weblog.function="CarRes" or "CARRES"$weblog.xmlstr,1,0)) as Bookings ]+;
[from weblog order by weblog.agent group by weblog.agent]
=sqlexec( oConnection,  lcStr, "TempCursor" )
TIA
Jaime
Why do programs stop working correctly as soon as you leave the Fox?
Next
Reply
Map
View

Click here to load this message in the networking platform