Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends

i want table and i want to update View1 when current date is middle of fromdate and todate
RoleId MenuId ViewM FromDate FromTime ToDate ToTime
1 1 0 13/06/2012 10:00 16/06/2012 19:00
1 2 0 13/06/2012 10:00 13/06/2012 15:00
1 3 0 13/06/2012 10:00 13/06/2012 15:00
1 4 0 10/06/2012 10:00 30/06/2012 19:00
1 5 0 13/06/2012 10:00 13/06/2012 15:00
1 6 0 14/06/2012 10:00 22/06/2012 15:00
1 21 0 16/06/2012 10:00 17/06/2012 19:00
1 22 0 15/06/2012 10:00 13/06/2012 15:00
1 23 0 13/06/2012 10:00 28/06/2012 15:00
1 45 0 13/06/2012 10:00 13/06/2012 12:00



thanks
Posted
Comments
Thilina Chandima 16-Jun-12 8:11am    
explain more about your problem.
Sandeep Mewara 16-Jun-12 9:41am    
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.

1 solution

Assuming by "middle of fromdate and todate" you mean between fromdate and todate then the following statement will work to select a range of values between two dates:

SQL
SELECT * FROM mydatetable WHERE datefield BETWEEN @fromdate AND @todate


This is making use the BETWEEN operator.

The MSDN article for this operator can be found here:

http://msdn.microsoft.com/en-us/library/ms187922.aspx[^]
 
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