Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error in SQL Request
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01056855
Message ID:
01056969
Views:
22
As Sergey pointed when you use UNION (in versions before VFP9) you can't use the Names of the fields just their positions.

>>The error is not for GROUP BY because you didn't have one but for ORDER BY :o)
>>Try to change it to:
>>
>>....
>>ORDER BY 1,8
>>....
>>
>>
>>>can someone tell me why this SQL request doesn't work in VFP8 ??? I got an error on ther "GROUP BY" clause
>>>
>>>
>>>SELECT CODEMED,NOINTERNE,NAM,NOM,DATENAISS,CODEDIAG,HONOTOTAL,DATEMAJ;
>>>	from factcur;
>>>	WHERE ((FACTCUR.STATUSFACT = "F") .AND.;
>>>		  (AT("B",FACTCUR.CONSSPECIA)<>0) .AND.;
>>>		  !EMPTY(FACTCUR.DATEMAJ) .AND.;
>>>		  BETWEEN(FACTCUR.DATEMAJ,M_DATDEB,M_DATFIN)) .AND.;
>>>		  BETWEEN(FACTCUR.CODEMED, M_MEDDEB, M_MEDFIN);
>>>union ;
>>>select CODEMED,NOINTERNE,NAM,NOM,DATENAISS,CODEDIAG,HONOTOTAL,DATEMAJ;
>>>	from facthisto ;
>>>	WHERE ((FACTHISTO.STATUSFACT = "F") .AND.;
>>>		  (AT("B",FACTHISTO.CONSSPECIA)<>0) .AND.;
>>>		  !EMPTY(FACTHISTO.DATEMAJ) .AND.;
>>>		  BETWEEN(FACTHISTO.DATEMAJ,M_DATDEB,M_DATFIN)) .AND.;
>>>		  BETWEEN(FACTHISTO.CODEMED, M_MEDDEB, M_MEDFIN) ;
>>>order by codemed,DTOCdatemaj ;
>>>INTO CURSOR facttmp
>>>
>
>IT WORK with ORDER BY 1,8..... I suppose it's because columns have no name yet during the SQL request...
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform