i have two textboxes 1 button and 1 gridview and 1 butto开发者_如何学Pythonn
database structure :
ID NAme Age date
1 sumit 24 1-Mar-2011
2 Manish 22 5-Mar-2011
what i want to do...
i have to text boxes textbox1 in which user enter from date and in textbox2 user enetr to date and after button clickevent the gridview will display the record between fromdate and to date..
mysql query ..
SELECT Ticket_no, journey_date, Travels, route, sel_seat, seat_opt, net_pay, name, mob, book_date, PNR_no FROM a1_ticket WHERE journey_date BETWEEN journey_date1 AND journey_date2 ORDER BY ID DESC
journey_date1 =textbox1
journey_date2 =textbox2
whats wrong in this query ?
ERREO : It will notdisplay record according to query ..
Change
orderby
to
order by
not sure if this will fix all your problems, or if that syntax is actually valid.
I think in the Query, there may be problem in Converting the Datetime to the format you specified in your table.
精彩评论