Pull Data Sequentially?

simpleton

Registered User.
Local time
Today, 13:10
Joined
Jul 7, 2008
Messages
21
I have a table with 2 text-blurbs in it. I need the data to populate in a rotating-like fashion. You, see I set it up to pull randomly.. but now they don't like random. So, how can I set this up to pull sequentially? So, every query will pull 1, then 2, then 1, then 2... etc.

Here's what i'm doing currently

SELECT TOP 1 PromoBlurb.PInfo
FROM PromoBlurb
ORDER BY Rnd(PromoID);
 
Show is in a spreadsheet an example of records that you describe.
 
Table "PromoBlurb"

Code:
Table: "PromoBlurb"

PromoID  PInfo
-------  --------------------------------------------
1        Super Summer Sale. 5% off our list price.
2        Did you know we sell other stuff too?
 
Two records doesn't tell us anything. Upload a good set of records, min 10 rows and indicate which field is the sequential numbering.
 
This table only has 2 records in it. I need them to populate on an order-receipt in a rotating-like fashion. Currently I have them randomly pulled. I need them to load up on my report in order.

IE: Run the report first time = Promo1 displays. Run it a second time = Promo2 displays. Etc.
 
You need some sort of variable that will determine the last used PromoID then create a Public Function that will get this value. In your query set a criteria of PromoID <> NameOfFunction()

In the report's Unload event, set the value of the variable to the one on the report. And remember to sort in Ascending order by PromoID.
 

Users who are viewing this thread

Back
Top Bottom