|
-
Nov 26th, 2000, 04:18 AM
#1
Thread Starter
Junior Member
Dear Reader,
I have a access database table named 'sales'.
'sales' table contains a field named 'solddate'.
(1). I am dynamically generating a ASP pages which gets data from this table. The condition i want to set for retreiving the records from the table is that the records retreived should not contain the records that have been added today, i.e. i want to retreive the records not having the value in 'solddate' field as todays date. How do I go about this?
(2). I want to dynamically delete the records from the 'sales' table such that the table contains records of the last seven days i.e. Any records that have the 'solddate' field value less than seven days less than today should be automatically deleted. How do i do that?
Any Code would be of great help.
Thanks in advance.
-
Nov 27th, 2000, 07:05 AM
#2
Frenzied Member
assuming that youor solldate field is of type date these should work
Code:
strSQL = "SELECT * FROM sales where solddate < " & now() & ";"
strSQL = "DELETE * FROM sales where solddate < " & now() -7 & ";"
conn.execute(strsql)
-
Nov 27th, 2000, 09:42 AM
#3
Thread Starter
Junior Member
Thanks
Thank you very much.
That worked and it helped.
Bye for now!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|