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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joining a set of numbers

Status
Not open for further replies.

serino

Programmer
Feb 13, 2003
112
US
I have two queries. First query is called Prefix and the second called Lot Numbers. Prefix contains a field that produces a set of numbers e.g 40214. Lot Number contains a field that also produces a set of numbers e.g 32.


How would join these two numbers in a new query and have a field display 4021432?
 
is there a common field between the two queries? If so something like:

SELECT PrefixQuery.FieldName & LotNumberQuery.FieldName As CombinedNumber From PrefixQuery INNER JOIN LotNumberQuery On PrefixQuery.CommonFIeld = LotNumberQuery.CommonField

Are the fields text fields or number fields?

if there is no common field to join on maybe a cartesian join would work:

SELECT PrefixQuery.FieldName & LotNumberQuery.FieldName As CombinedNumber From PrefixQuery, LotNumberQuery


Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
Thank You Leslie. The cartesian join worked great!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top