|
Posted by ZeldorBlat on 09/19/06 19:51
Mintyman wrote:
> Hi,
>
> I have the following query:
>
> SELECT dbo._Fault.id, dbo._Fault.date_created, dbo._Fault.reference,
> dbo._Fault.class, dbo._Fault.owner, dbo._Fault.Contact_Name, dbo._Fault.
> Product,
> dbo._Fault.Problem_Description,
> dbo._Fault.Action_Taken, dbo._Fault.Problem_Solution,
> dbo._Fault.Duration_start_date, dbo._Fault.Duration_duration,
> dbo._Fault.Duration_date_summary,
> dbo._Fault.Fault_Status, dbo._Fault.Fault_Source, dbo._Fault.Part_Number,
> dbo._Fault.Serial_No,
> dbo._Product.id AS PRODUCTID, dbo._Product.description
> FROM dbo._Fault LEFT OUTER JOIN
> dbo._Product ON dbo._Fault. Product = dbo._Product.id
>
> I need an additional field appended to the end of this (called
> 'DATECOMPLETED') that will take the 'Duration_start_date' and add the
> 'Duration_duration' to it - effectively giving me a new datetime field that
> is newer than the start date.
>
> I have tried unseccessfully to amend the code but I am afraid my knowledge
> of SQL is limited. I would greatly appreciate if someone could show me how
> to do this.
>
> Thanks,
>
> Darren
If Duration_duration is a number and you want it to be the number of
days added to Duration_start_date you would add something like this to
the select list:
dateadd(dd, Duration_duration, Duration_start__date)
Navigation:
[Reply to this message]
|