DateDiff function

  • Thread starter ironwood9 via AccessMonster.com
  • Start date
I

ironwood9 via AccessMonster.com

I have tried, but can't get the syntax right - I have a db that tracks filing
due dates, and I want to run an action query that affects the DueDate field.
If the "filed" field (Yes/No datatype) is checked (true), then I want to set
the "filed" field to false, and make the DueDate 20 days after the end of the
current quarter.

Any Ideas ?
 
K

Ken Snell \(MVP\)

Post the SQL statement that you're trying to use so that we can see it and
make recommendations.
 
J

John Spencer

UPDATE [YourTable]
SET [DueDate] = DateSerial(Year(Date()), DatePart("q",Date())*3+1,20)
, [Filed] = False
WHERE [Filed] = True

In the query grid (Design view)
-- Select your table
-- Add DueDate and Filed fields
-- Criteria under Filed = True
-- Select Query: Update from the menu
-- Enter False under Filed in the Update To
-- Enter DateSerial(Year(Date()), DatePart("q",Date())*3+1,20) under DueDate
in the Update To
-- Select Query: Run from the menu

WARNING: Backup your data first. You cannot undo an update query.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top