Skip to Content
author's profile photo Former Member
Former Member

"Hoy menos 30 dias"

Hola a todos como están? tengo este código : pero no recuerdo como le digo a SQL "hoy menos 30 dias"

if @object_type = 17 and @transaction_type = 'A'

begin

if exists(select T0.cardcode from OCRD T0 inner join OINV T1 on T1.cardcode = T0.cardcode

where T1.canceled ='N' and T1.docstatus = 'O' and T1.doctotal > T1.paidtodate and T1.docduedate < ("hoy menos 30 días")

select @error = 6009, @error_message = 'Cliente con alguna factura vencida mas de 30 dias'

Saludos

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 14, 2014 at 10:32 PM

    Gerardo,

    En lugar de T1.DocDueDate < ("hoymenos30días") usa esto:

    datediff(dd,T1.DocDueDate,getdate()) > 30

    Saludos,

    JC.

    Add a comment
    10|10000 characters needed characters exceeded

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.