Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003

    Unanswered: Two Queries Inside One?

    I want to perform two actions inside a query. I can do
    this in SQL Server but I do not know how in Access. Can
    someone shed some light on this? Here is what I would
    like to do:

    PARAMETERS recipe_name Text ( 255 ), index_dist
    IEEESingle, rotation IEEESingle, edit_time DateTime,
    username Text ( 255 );

    SELECT Recipe.Curr_Index AS Old_Index,
    Recipe.Curr_Rotation AS Old_Rot
    FROM Recipe
    WHERE Recipe.Name = @recipe_name;

    UPDATE Recipe SET Recipe.Curr_Index = @index_dist,
    Recipe.Curr_Rotation = @rotation,
    Recipe.Prev_Index = Old_Index, Recipe.Prev_Rotation =
    Old_Rot, Recipe.Edit_Time = @edit_time, Recipe.User_Name
    = @username
    WHERE Recipe.Name = @recipe_name;

  2. #2
    Join Date
    Jun 2003
    Provided Answers: 1
    Technically GrindAZ, you can't do this in a single query in SQL server either. You do it using two queries in a stored procedure.

    Use the same strategy in Access by embedding these queries in a
    VB subroutine or function, or (if you want to look like an amateur) in a macro.

    Try using:

    DoCmd.RunSQL "Insert your favorite query string here"


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts