Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
dear sir/ma'am

i have a table for leave post..
table name=h_leave
fromdate todate reason
08/05/2013 10/05/2013 holiday

when i select 09/05/2013 the status is close.
sir how can i do it with please help me.

sir i want to check the range as

select * from h_leave where fromdate<09/05/2013< todate

sir how can i read such a query please help
Posted
Updated 16-Jun-13 19:48pm
v4

Check with following Stored Procedure...

CREATE PROCEDURE [dbo].[StoredProcedureName]
(
@SelectedDate Date
)
AS
SELECT * FROM h_leave where fromdate<=@SelectedDate AND todate>=@SelectedDate
 
Share this answer
 
Use Between instead of <=, >= operators.

Hope it helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900