Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Repeat region problems????

Posted 25 Apr 2002 12:32:29
1
has voted
25 Apr 2002 12:32:29 Andy Smith posted:
Hi
Does anyone know how to sort descending time fields in a 5 record repeat region but displaying the latest time at the end?

i.e

11.25am
11.27am
11.27am
11.29am
11.30am

If I try and do an ascending format then I have to display 'all records' to see the newest time (not possible with the amount of records in the db)

If this makes any sense then please help!

Andy

Replies

Replied 25 Apr 2002 13:55:15
25 Apr 2002 13:55:15 Andrew Watson replied:
Can you clarify a little Andy?

If you create a recordset sorted on TIME ASCENDING then put a repeat region around it showing 5 records then that should give you what you want....?


Im just going to try it back soon.....

Leed

:: Son, im Thirty.... ::
Replied 25 Apr 2002 14:02:26
25 Apr 2002 14:02:26 Andrew Watson replied:
Yep it works fine,....

Points Tho' !!

Is your time field actually stored as a date/time ? it should be.

So youve got a table with a field containing a time. Create a recordset from this sorting time ascending, write the time field to the page, then apply a repeat region (5 records) to it. The first 5 records are shown with the latest time last.

If this isnt what you want then youll need to clarify your problem.

Cheers
Leed

:: Son, im Thirty.... ::
Replied 25 Apr 2002 19:04:53
25 Apr 2002 19:04:53 Andy Smith replied:
I sorted it!

I needed to display the last 10 or so records and I found a way with this:

SELECT timestamp, id, message, datestamp, user
FROM messages
WHERE id IN (SELECT TOP 20 id FROM chat ORDER BY timestamp DESC)
ORDER BY timestamp

And it works fine

Cheers & hope it helps someone else <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic