I have been tasked with creating a flat file. One of the fields that I need is a date field. I need the disco date to be LAST\_EVENT\_PROC\_DT + 12 unless that date falls on a weekend or holiday,if so the disco date would be the next business day. This date field is stored in my system as a Numeric field. I am trying to write it is a case statement using our holiday table and some weekend exclusion code.
This is the column I am trying to query:

```
LAST_EVENT_PROC_DT (numeric(8,0),not null)

```

It holds a date formatted like: 20150506

This is the flat file output:

```
'' + '|' +
'' + '|' +
cast(q.NEXT_EVENT_PROC_DT as varchar) + '|' + -- Due Date
cast(q.LAST_EVENT_PROC_DT +12 as varchar) + '|' + -- Disco Date = Due date +15
CONVERT(VARCHAR(10),GETDATE() +15,112) + '|' + -- Agency Send Date todays date + 15

```

I am using SQL Server 2014