i have two textboxes 1 button and 1 gridview and 1 button
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.
我认为在查询中,将Datetime转换为表中指定的格式可能会出现问题。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.