Link to home
Start Free TrialLog in
Avatar of westdh
westdhFlag for United States of America

asked on

ASP.Net Need to know how to select and enter into a select statement begin & ending date froma calendar

Need to know how to select and enter into a select statement begin & ending date from a calendar

selectied begin date & end Date from a calendar and enter them into a select where clause??

the SignUpDate is a datetime
selecting begin date & end Date from a calendar 
<asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="BeginDate" PopupButtonID="Image1">
    </asp:CalendarExtender>
    End Date&nbsp;&nbsp;<asp:TextBox ID="EndDate" runat="server" Width="70"></asp:TextBox>
     <asp:Image id="Image2" runat="server"  ImageUrl="~/images1/calendar_scheduleHS.png" />
    <asp:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="EndDate" PopupButtonID="Image2">
    </asp:CalendarExtender>
-----------------------------------

*
*
*
  WHERE E.IsLockedOut = 'False' and (SignUpDate BETWEEN @BeginDate AND @EndDate)

) SQ
     ORDER BY userId, SignUpDate DESC">
  
           <SelectParameters>
                <asp:parameter  Name="UserID" DbType="String" />
                <asp:parameter  Name="BeginDate" DbType="String" />
                <asp:parameter  Name="EndDate" DbType="String" />
           </SelectParameters>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of deemehtani
deemehtani
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Anil Golamari
Anil Golamari
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if you just need the date not time of the day then you can just make this modification on the tostring():

 string x = Calendar1.SelectedDate.Date.ToString("MM/dd/yyyy");
Avatar of westdh

ASKER

Yes, i am not interest in the time. Now  s there a way I can convert    
the string within the paramater seeting via:
 string x = Calendar1.SelectedDate.Date.ToString("MM/dd/yyyy");


        WHERE E.IsLockedOut = 'False' and (SignUpDate BETWEEN @BeginDate AND @EndDate)

) SQ
                      ORDER BY userId, SignUpDate DESC">
 
           <SelectParameters>
                <asp:parameter  Name="UserID" DbType="String" />
                <asp:parameter  Name="BeginDate" DbType="String" />
                <asp:parameter  Name="EndDate" DbType="String" />
           </SelectParameters>
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of westdh

ASKER

almost but i get a server tag not well formed

Where e.islockedout = 'false' and (Signupdate between begindate.text.tostring("MM/dd/yyyy") And enddate.text.tostring("MM/dd/yyyy")

also the date MM dd yyyy all are redline Possible problem with /  /??
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of westdh

ASKER

i stille get a not well formed error?

 Where e.islockedout = 'false' and (Signupdate between begindate.text.tostring("MMddyyyy") And enddate.text.tostring("MMddyyyy")
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of westdh

ASKER

Thanks