web dunia
web dunia

Reputation: 9939

Check In between two times

I want to check in IF in sql server..

I am having check in time

and parm1time and paramtime2

I want to return the value if checkin time is between param1 and param2

how can I write.

Example @checkin = 10.00 param1 = 2.00 param2 = 13.00

How can I do this in sql query IF COndition

Upvotes: 1

Views: 660

Answers (2)

gbn
gbn

Reputation: 432511

SELECT
....
WHERE @checkin BETWEEN @param1 AND @param2

or

....
IF @checkin BETWEEN @param1 AND @param2

etc

Upvotes: 2

Rubens Farias
Rubens Farias

Reputation: 57976

IF @checkin >= param1 AND @checkin <= param2 BEGIN
    -- // do stuff
END

Upvotes: 0

Related Questions