0

Hi! I have in my database few tables and each table have a column with dates of inserting records. I don't know how to go through the database, through all tables, in chronological order, from the first inserted record until the last, can anyone help? tnx!

2
Contributors
3
Replies
22
Views
4 Years
Discussion Span
Last Post by JorgeM
1

What do you mean by this statement:

"have a column with dates of inserting records"

With regard to...

I don't know how to go through the database, through all tables, in chronological order

You use a SQL SELECT statement to query the database table. If you have more than one table that has the desired information, you JOIN the tables in your SQL Query. With regard to controlling the order, you use the ORDER BY keywords in your SQL statement.

0

Ok, tnx, i meant that column with dates is automatically filling when i insert the record, it shows the date of the inserting. So, I wanted to go through all records in database from the first insert.

1

If the date column is being filled with the actual date the record is being inserted, then they should already be in order. But in any case, to sort by date, your SQL query would be something like this...

SELECT fieldDate, field2, field3 FROM table1 ORDER BY fieldDate ASC

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.