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

Repeat a value in a query

Status
Not open for further replies.

rlmorgan

Technical User
Jun 2, 2006
32
US
I can’t find a way to get this to work and need a little help.

I have a query that pulls all of the parts that have not been ordered from a table that contains repairs and parts histories. The query is a make table query that a Word mail merge is pulled from. All of the mail merge documents go to the same email address and have to be sent individually. My question is how I can add the same email address to every record in the resulting table?

Any ideas?
 
Code:
Select fld1, fld2, 'joeblow@someisp.com' As [email], ...

From t1 INNER JOIN t2 ...
 
Thanks Golom for the quick responce. Sorry, I am just new enough I haven't a clue haw to use what you just added...

How do I use this, and where?
 
You said "... I have a query ..." and that query (if it is returning records) probably starts with SELECT followed by a comma separated list of fields. To that list of fields you would just add
'joeblow@someisp.com' As [/quote] as a new field (separated by commas from the existing fields.)

I've hard-coded the email address in this example just for simplicity but you could use a parameter or the value from some control on a form to supply it instead.
 
In the grid you use to create the query, place "someone@somewhere.com" as Email at the top of a blank column.


Randy
 
Randy, the usual way is (in the query grid):
Email: someone@somewhere.com
 
Of course it is.... d'oh
Thanks for correcting me PHV.


Randy
 
Thanks to both of you for the help. It is working great now.

MailTo: "someone@somewhere.com"
 
if you switch to the SQL view of the query you will see that Access has taken the information you put in the Query Design Grid and created an SQL statement that looks just like the first answer posted! To increase your understanding of SQL you could switch to the SQL view and see how to type the query yourself.



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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top