Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: how to populate a variable with a query result

    How about this (assuming your ID field is an identity column) --

    DECLARE @ID_Machine_Info int

    SELECT TOP 1 @ID_Machine_Info = MI.ID_Machine_Info FROM

    (SELECT TOP 6 ID_Machine_Info FROM tblMachineInfo

    WHERE Date >= CONVERT(CHAR(10), GETDATE(), 102)

    ORDER...

Viewing post 1 (of 1 total)