Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Within Date Ranges 1

Status
Not open for further replies.

edrossi

Programmer
Joined
Jan 24, 2002
Messages
42
Location
US
I am trying to execute this statement, but the records that fall into the range are not being marked for deletion. Any ideas:

store date()-730 to year2
store date()-365 to year1

delete from alias() where between(date,year2,year1)

Thanks

E Rossi
 
Ed,
Is the field really "date"? Have you tried:
DELETE FROM ALIAS() WHERE date BETWEEN year2 AND year1
Sometimes SQL statements require SQL syntax - the Between() function is strictly FoxPro.

Also is the tablename the same as the current ALIAS(), this statement wants a REAL table name not just an alias.

Rick
 
HI

USe the command..

DELETE IN ALIAS() FOR BETWEEN(date,year2,year1)

Hope this solves your problem :-)

ramani :-)
 
Also remember that the currently selected table cannot be at EOF() or the records won't get deleted.

Dave S.
 
you may use "Locate" or "Go Top" before issuing the command. Continuation for the comment that dsumzzzz suggested!!!
 
check your field type it may be T type which is data and time together. If this is the case use TTOD(table date field )
Returns a Date value from a DateTime expression
Attitude is Everything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top