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!

Re: going through database in chronological order 80 80

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.

Re: going through database in chronological order 80 80

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.

Re: going through database in chronological order 80 80

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.