Timestamping

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I'd like to timestamp the rows I return from our db (db2) on the AS/400. I've
done this before, using a pass-thru query, using "Now()" with vba. I'm trying
to do the same thing with Access (2000), where I'm not using vba. I'm just
wanting to add another column. "Now()", "Time()", "Date()" don't work. Access
keeps telling me to enter a paramter value.

Can I do this? If so, how?

Thanks in advance,

Tom
 
Tom

You posted in a "queries" newsgroup. Where, in your query, are you trying
to use these functions?

Jeff Boyce
<Access MVP>
 
SELECT DISTINCT
tblCXLIB_UT220AP.UTLCID AS [Loc ID],
tblCXLIB_UT220AP.UTCSID AS [Cust ID],
tblCXLIB_UT220AP.UTAUNT AS Units,
tblCXLIB_UT220AP.UTSSTY AS [Init YY],
tblCXLIB_UT220AP.UTSSTM AS [Init MM],
tblCXLIB_UT220AP.UTSSTD AS [Init DD],
tblCXLIB_UT220AP.UTSVC AS Svc,
tblCXLIB_UT220AP.UTSSTS AS Stat,
Now() AS Stamp <<--- here

INTO
tblElecRateReview_UT220AP

FROM
tblCXLIB_UT220AP

WHERE
(((tblCXLIB_UT220AP.UTSVC)="EL") AND ((tblCXLIB_UT220AP.UTSSTS)="A"))

ORDER BY
tblCXLIB_UT220AP.UTLCID, tblCXLIB_UT220AP.UTCSID;
 
Tom

If you would do a small test ...

Create a new empty query and only add the one field --

Stamp: Now()

Does it work?

If it doesn't, you may need to check your References...

Jeff Boyce
<Access MVP>

Tom said:
SELECT DISTINCT
tblCXLIB_UT220AP.UTLCID AS [Loc ID],
tblCXLIB_UT220AP.UTCSID AS [Cust ID],
tblCXLIB_UT220AP.UTAUNT AS Units,
tblCXLIB_UT220AP.UTSSTY AS [Init YY],
tblCXLIB_UT220AP.UTSSTM AS [Init MM],
tblCXLIB_UT220AP.UTSSTD AS [Init DD],
tblCXLIB_UT220AP.UTSVC AS Svc,
tblCXLIB_UT220AP.UTSSTS AS Stat,
Now() AS Stamp <<--- here

INTO
tblElecRateReview_UT220AP

FROM
tblCXLIB_UT220AP

WHERE
(((tblCXLIB_UT220AP.UTSVC)="EL") AND ((tblCXLIB_UT220AP.UTSSTS)="A"))

ORDER BY
tblCXLIB_UT220AP.UTLCID, tblCXLIB_UT220AP.UTCSID;

Tom

You posted in a "queries" newsgroup. Where, in your query, are you trying
to use these functions?

Jeff Boyce
<Access MVP>
 
Yes it does! Wow. Since *this* works...I went to work on my other queries...

I have about a half dozen other make table queries and an append query. This
works in all of those. But I still can't get it to work in *this* query
(below), which in fact is the first to be run, of the series. Why only *this*
one I wonder?

Tom

If you would do a small test ...

Create a new empty query and only add the one field --

Stamp: Now()

Does it work?

If it doesn't, you may need to check your References...

Jeff Boyce
<Access MVP>

Tom said:
SELECT DISTINCT
tblCXLIB_UT220AP.UTLCID AS [Loc ID],
tblCXLIB_UT220AP.UTCSID AS [Cust ID],
tblCXLIB_UT220AP.UTAUNT AS Units,
tblCXLIB_UT220AP.UTSSTY AS [Init YY],
tblCXLIB_UT220AP.UTSSTM AS [Init MM],
tblCXLIB_UT220AP.UTSSTD AS [Init DD],
tblCXLIB_UT220AP.UTSVC AS Svc,
tblCXLIB_UT220AP.UTSSTS AS Stat,
Now() AS Stamp <<--- here

INTO
tblElecRateReview_UT220AP

FROM
tblCXLIB_UT220AP

WHERE
(((tblCXLIB_UT220AP.UTSVC)="EL") AND ((tblCXLIB_UT220AP.UTSSTS)="A"))

ORDER BY
tblCXLIB_UT220AP.UTLCID, tblCXLIB_UT220AP.UTCSID;

Tom

You posted in a "queries" newsgroup. Where, in your query, are you trying
to use these functions?

Jeff Boyce
<Access MVP>

I'd like to timestamp the rows I return from our db (db2) on the AS/400.
I've
done this before, using a pass-thru query, using "Now()" with vba. I'm
trying
to do the same thing with Access (2000), where I'm not using vba. I'm
just
wanting to add another column. "Now()", "Time()", "Date()" don't work.
Access
keeps telling me to enter a paramter value.

Can I do this? If so, how?

Thanks in advance,

Tom
 
Tom

The test was to see if it was a general issue (then I'd point to References)
or a specific issue (and it is).

There's something "stuck like a chicken bone" in Access' throat on that one
query.

When this happens to me, I create a new query and throw away the old one.
Folks with more patience than I have might try to figure out where/how the
query got corrupted, but I've rather just have it work!

Good luck

Jeff Boyce
<Access MVP>
 
Thanks SOOO much. I appreciate the assist.

Tom

Tom

The test was to see if it was a general issue (then I'd point to References)
or a specific issue (and it is).

There's something "stuck like a chicken bone" in Access' throat on that one
query.

When this happens to me, I create a new query and throw away the old one.
Folks with more patience than I have might try to figure out where/how the
query got corrupted, but I've rather just have it work!

Good luck

Jeff Boyce
<Access MVP>
 

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

Back
Top