Thanks Edgar
The table name are in this format payJAN03,PayFEB03....
so when the user select JAN03 & APR03 from combobox my sql should loop thru
JAN03,FEB03,MAR03,APR03 and fetch the data.
Thanks for your time
>startdt and enddt are these two fields in the table or your parameters?
>if last then you can do:
>
>SELECT datefld FROM table WHERE BETWEEN(datefld, startdt, enddt)into CURSOR temp
>
>and if "loop" means to go over all the records returned
>you can
>
>SELECT Temp
>SCAN
>.... DO whatever with each record
>ENDSCAN
>
>is this what you want?
>
>
>>Thanks for the replies, but what i wanted was it has to loop thru the dates selected by the user. say if the user selected startdt JAN03 enddt APR03, it has to fetch all the data from Jan 03 ... APR 03.
>>
>>Thanks
>>
>>
>>>something like :
>>>
>>>lsql="SELECT Fld1,fld2,fld3 FROM mytable WHERE fld2= ?cParam"
>>>lnResult=SQLEXEC(lnHandle,lsql,'tempTbl')
>>>
>>>that will place it in a CURSOR
>>>
>>>>Hello
>>>>
>>>>In a client-server environment , how can retrieve data from tables by SQL
>>>>
>>>>eg i have payfiles like PayJan03,payFeb03,PayMar03 and if the user select Jan 03 .. Apr03 how can select the data by SQL into a temp table ?
>>>>
>>>>TIA