Skip to Content

error must declare the scalar variable

por que me marca ese error una consulta?

DECLARE  @feci AS datetime
DECLARE @fecf AS datetime

SET @FECI=(SELECT DISTINCT(T0.DOCDATE) FROM ORTT T0 WHERE T0.DOCDATE='[%0]')
SET @FECF=(SELECT DISTINCT(T0.DOCDATE) FROM ORTT T0 WHERE T0.DOCDATE='[%1]') 

EXEC DBO.COMPARATIVO @FECI,@FECF


Edited by: mary merecias on Nov 17, 2011 3:15 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Nov 17, 2011 at 10:19 PM

    Puedes poner el error completo?

    Add a comment
    10|10000 characters needed characters exceeded

    • lo puse felipe como me dijiste pero no funciono así. le agregue unas cuantas cositas y jalo 😊

      Gracias 😊 a los dos me ayudan mucho en serio :):D!!

      DECLARE @VAR AS INT, @FEC1 AS DATETIME,@FEC2 AS DATETIME
      
      SET @VAR=(SELECT TOP 1 A.TransId FROM dbo.JDT1 A WHERE A.RefDate BETWEEN '[%0]' AND '[%1]')
      SET @FEC1='[%0]'
      SET @FEC2='[%1]'
      
      EXEC  COMPARATIVO @FEC1,@FEC2
      
      

      en mi intuición me dice que el parche no acepta algo de eso por que en otra version posterior si podía hacer esto.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.