Retreive a Record in a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can you direct me to how to pull up any records in a query once someone has
added a new record?

Example.

I had 100 records in my table yesterday. This morning I entered 5 more
records. What expression would I use in my query to pull up only those 5
records I entered?

Say my fields are: ProductID, ProductLine, State, Zipcode etc
 
If you have a date field in the table that indicates when the record was
inserted, then filter the query on yesterday date

Select * From TableName Where DateField = Date()-1
=======================================
If that what you want, but you don't have a date field in the table, then
create one and write in this date field default value Date(), so every time a
record is inserted to table the record will have the date in it.
=======================================
If you just want the Last five records no metter when they were inserted to
the table, if you have a key field that indicate the order that this record
were inserted to the table (Like a counter), you can use

Select Top 5 TableName.* From TableName Ordr By KeyField Desc
 
No but that would work. I just have 4 tables in my query and none has a date
field. Wouuld this expression work under each field if they add something
into that field.

Such as: <>[dbo_tblSaaDocument].[ClassCode]

I need it to be updated to a master table if any of the fields are updated
in any of the 4 tables I have in my computer. I also want to tell you thank
you for this expression you gave me several days ago
Attachments: IIf([dbo_tblProductversion].[Attachments]=True,"Y","N")

It saved my rear end. You know something. It will not work in an update
query but works fine in an Append query. Anyway let me kknow if my expression
above seems logical.

Thanks again
 

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