No, you cannot run two queries as one query.
Even in MS SQL Server you are executing separate queries. You just have
syntax that lets you put them into one container.
In Access, you can use a VBA function to run the queries in sequence. (or a
macro).
AIR CODE Follows - no error handler, no transaction,
Public Function fRunMultipleQueries()
Dim dbAny as DAO.Database
'Only action queries (Append, Update, Delete)
'and data definition queries allowed
Set dbAny = dbEngine(0)(0)
dbAny.Execute "NameOfQuery1", dbFailOnError
dbAny.Execute "NameOfQuery2", dbFailOnError
End Function
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
Picasso said:
OK maybe i'm using the wrong exaples all the time??
Say for instance i have a once off table that will never change and no one
but me has access to the table. Two tables, 'CustomerList' and
'BadCustomers'
i want to match the customers in my CustomerList to see if there are any
customers with bad records with the company. but in my 'BadCustomers'
table i
have the customers details as 'J SMITH' in one field and 'J' 'SMITH' as
two
fields in my CustomerList table.
thus to concatenate the Initails and LastName ...
query1...
update CustomerList
set [JointName] = [Initial]&' '&[LastName]
query2
delete CustomerList.*
where [CustomerList].[JointName] = [BadCustomers].[Name]
My question is this...regardless of database ethics and should or should
not
be done or which is easier that something else...
can i, instead of running two different queries, run this as one query or
one function? ie...in SQL Server you can do this as two statement and put
'go' between the statements wich would result in SQL running the second
statement as soon as the first one is done
Keith Wilby said:
is it possible to update two columns after each other, using one query?
ie...
i need to update an AGE field from Date of Birth of a person and then
after
that, update a field to flag people in certain age groups?
i can do this running two different queries but can it be done in one??
please help
You don't need to store these values (and indeed you *shouldn't*) at all
because they can be calculated at run-time. Age is Date() - DOB. If you
post details of your other requirements for age groups I'm sure me or
someone else will be able to help.
HTH - Keith.
www.keithwilby.com