mercredi 8 février 2017

sql - generate random date, exluding weekends

Vote count: 0

I would like to ask you for a help with the query. I´m trying to get list of random dates from 7.2.2016 - 14.2.2016, but I would like to exclude from it 11. and 12.2.2016, which will be weekends.

This is, what I have:

SELECT DATEADD(DAY, ABS(CHECKSUM(NEWID()) % 8), '2016-02-07')

I´m using SQL server 2016.

Thank you for your advices!

asked 39 secs ago

Let's block ads! (Why?)



sql - generate random date, exluding weekends

Aucun commentaire:

Enregistrer un commentaire