Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to convert days into number.

$
0
0

If the user want to archive data older than 30 than @numberofDay should convert into date like 11/03/2013.
They want to pass in days as int and the process should convert that into day.

Any help would greatly appreciate.

Declare @NumberofDay INT = 30

-- No

@NumberofDay  should be something like '11/03/2013'


DELETE FROM MyBilling
OUTPUT deleted.[__$start_lsn], deleted.[__$seqval], deleted.[__$operation], deleted.[__$update_mask], deleted.[BillingDetail_ID]
  INTO ArchiveAudit.MyBilling_CT ( [__$start_lsn], [__$seqval], [__$operation], [__$update_mask], [BillingDetail_ID]

 WHERE (CONVERT(CHAR(8), [Effective_date], 112) < @NumberofDay )  -- This some how become '11/03/2013'


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>