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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append Query Help 1

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I have an append query that appends records into two tables..is there a way to just append todays records only?

I have a field called logindate..i want to append the query with the login date =Now() when i try that it doesnt work...I tryed a couple of other criterias but non of them seem to work..

can someone help with this?

thanks DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 

Don't use Now(). Use Date() instead.

Where [Login Date] = Date() Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
I put that in the criteria and it wont work..

Where [LoginDate] = Date()

I put that in the criteria..

it comes back saying do you want to append 0 rows

DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 

I suspect the LoginDate was created using now() and thus has times as well as dates. Try this query.

Where DateValue([LoginDate]) = Date()

Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
Thanks for your help it worked great.

I do have one other similar question. I have an update query that strips the time off the date field.

DateValue([logindate])

but im trying to set in the criteria to only update todays date...like =Date()

i cant seem to make it work.

Thanks DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 

I'm not clear about what you mean. Perhaps, you could post the query and any messages or results you get when you run it. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
OK

It's an update query that updates the loginadate. see the logindate is =Now() when the user clicks a check box on a form. so i needed to strip the time of that field to run other query's.

so in my query i have:

Update to: DateValue([logindate])
Criteria:

In my Criteria I only want it to update records =Date()

Rather then have it scroll through the whole table...There is about 6000 records in this table. If i update only records =Date() then it will run much faster and will not even look at the other rocrds..


Thanks

DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 

Is this what you mean?

Update table
Set LoginDate=datevalue(LoginDate)
Where datevalue(LoginDate)=date()

OR

Update table
Set LoginDate=date()
Where datevalue(LoginDate)=date()
Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
no luck...what statement should i put in the criteria field?? DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 

In the query design grid, you need to add a new column. In that column type or paste DateValue([LoginDate]) and then add Date() to the criteria of that column. Don't put anything in the criteria of the column you are updating (LoginDate). Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
no it still comes back with append 0 rows...it's probally because im trying to take the time off the end of the date at the same time as specify the current date..

is there another way around this..

DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 

Open your update query in design view. Then select View | SQL View from the menu. You should see the query statement. Copy the query statement to the clipboard and paste it into a post in this thread. That will allow me to see what your query is doing.

Thanks, Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
UPDATE [Laboratory Drums] SET [Laboratory Drums].releasedate = DateValue([releasedate])
WHERE ((([Laboratory Drums].releasedate)=Date()));

Thanks DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 

Paste the query below into the SQL View Window and it should work.

UPDATE [Laboratory Drums] SET [Laboratory Drums].releasedate = DateValue([releasedate])
WHERE DateValue([Laboratory Drums].releasedate) = Date();
Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top