Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Labels, need help with duplication

Status
Not open for further replies.

newtosql0001

Technical User
Apr 4, 2002
9
US
I'm creating a avery 5260 label with our address and have 1 piece of information from our database, an account number. I always want 60 labels and cannot figure out how to get cr 8.5 to do this. I have a parameter field for a date, all accounts where their start pmt date is (user defined) should have labels printed (60)
(name 1, add1 and add2) can either be a text box or fields from database.
Name1
Add1
Add2
AccountNO-

Thank you.
 
Do you have a table with a minimum of 60 records in it (something like a calendar table)?

If so, you can do something like the following to get 60 duplicate records for a single record...

Original text from Datebase>Show SQL Query:
Code:
SELECT
    Contact."Name", Contact."Address1",
    Contact."Address2", Contact."AccountNumber"
FROM
    "Contact" Contact
WHERE
    Contact."Name" LIKE 'B%'

which returns a list of all of the contacts with Name beginning with 'B'.

To get 60 records for each contact, I modified the query in the Show SQL Query like this:
Code:
SELECT
    Contact."Name", Contact."Address1",
    Contact."Address2", Contact."AccountNumber",
FROM
    "Contact" Contact
Code:
JOIN
    (SELECT TOP 60 Date FROM Calendar) C ON 1 = 1
Code:
WHERE
    Contact."Name" LIKE 'B%'

which returns 60 records for each contact whose name begins with 'B'.

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top