Random based on Date

  • If anyone can help I would be very grateful

    Here is what i need, to pull a random person from a single table based on a Date parameter for a stored procedure,

    ALTER proc [dbo].[random_winner_RR_SC]

    @date smalldatetime = null

    as

    SELECT TOP 1 * FROM scandata

    where sdDateTime = @date

    ORDER BY NEWID()

    When I put in a date time that I know is in the database I don't get any results, I know I have to convert the date but can't get it working, Can someone please help me with this.

  • Sorry everyone I figured this out, It was the conversion of the date time but I have it working.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply