Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Nicole Hughes   on Jun 19 In Asp.net Category.

  
Question Answered By: Alvin Nguyen   on Jun 19

1. just one calendar  with the current month
Here user willhave all the dates displayed for current month, user click on one and u can display the results for that particular date as:
select * from tablename where date = @choice1date
and
if we assume that in choice 1 user cliked on 2 dates and he wants results between them the
SELECT * from Tablename where date bwtween(@startdate AND @enddate)
and finally
assuming user clicked on the month on any date but you want results is grid for teh whole month then:
select * from Tablename where month(datefieldintable)=@monthnumber
The month number can be obtained from the datetime variable as there is a propert datevar.month.tostring and then a "case select " to give you teh number for the month u got.
2. three calendars with the previous month the current month and the month to come
My understanding regarding this is the from eahc calender user selects two dates and u can display the results between two dates:
SELECT * from Tablename where date bwtween(@startdate AND @enddate)
or
if you want the result as to be for the whole two selected months then:
select * from Tablename where month(datefieldintable) => @startmonthnumber and month(datefieldintable) <= @endmonthnumber

If these assumptions are ok then answer for 3rd can be obtained from above.

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Getting a range of values Or get search suggestion and latest updates.


Tagged: