 |
ต้องการ selcel ข้อมูล โดย แยกข้อมูลออกตาม วัน และเดือน จะกำหนดเงื่อนไขตรง where อย่างไรดีคะ |
|
 |
|
|
 |
 |
|
ผมไปเผ็นมาแว่บ ๆ ลองปรับดูนะ
select * from asset where date_recieved between '".($_POST["required_date"]-544)."-10-01' and '".($_POST["required_date"]-543)."-09-30' ";
|
 |
 |
 |
 |
Date :
2014-03-07 15:28:28 |
By :
apisitp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอบความคิดเห็นที่ : 1 เขียนโดย : apisitp เมื่อวันที่ 2014-03-07 15:28:28
รายละเอียดของการตอบ ::
ได้เรียบร้อยแล้วคะ ใช้ SUBSTRING มาช่วยคะ ^^
Code (SQL)
select convert(varchar, flight_date, 103) AS fligthDate,SUBSTRING (convert(varchar, flight_date, 103),0,3) AS days,SUBSTRING (convert(varchar, flight_date, 103),4,2) AS months
from ka_flight_sche
where SUBSTRING (convert(varchar, flight_date, 103),4,2) like '%03%'
and SUBSTRING (convert(varchar, flight_date, 103),0,3) like '%%'
and YEAR(flight_date) like '2013'
|
ประวัติการแก้ไข 2014-03-07 16:24:43
 |
 |
 |
 |
Date :
2014-03-07 16:22:54 |
By :
Baitong_ch |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|