>>>>>How would I change the above for VFP database? Does VFP have function similar to the SQL Server's DATEADD()?
>>>>>
>>>>>TIA
>>>>
>>>>Dmitry,
>>>>
>>>>You can GOMONTH(somedate, 12 * number of years) to get years advance (or step back).
>>>
>>>Antonio,
>>>
>>>Thank you very much! I didn't know of this function. This should do the job.
>>
>>How do I make an expression that I could use in the Where clause of the SQL Select (using the GOMONTH() approach). I have been trying many ways but still can't get it without an error.
>>
>>Here is one try:
>>
>>cWhereExpr = ['] + DTOS( dToday ) [' >= GOMONTH(PurchDate, Years*12 ) ]
>>
>>
>>What is wrong with above?
>
>Dmitry, in VFP you must compare a date with a date, or a string with a string.
>
>So, either
>
>cWhereExpr = "'" + DTOS( dToday ) "' >= DTOS(GOMONTH(PurchDate, Years*12 ))"
>
>(in fact,
>
>cWhereExpr = "DTOS( dToday ) >= DTOS(GOMONTH(PurchDate, Years*12 ))"
>
) or
>
>cWhereExpr = "dToday >= GOMONTH(PurchDate, Years*12 )"
>
Antonio,
Your top choice (with DTOS()) works perfectly! Thank you!!
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham