|
 |
|
ช่วยดูเรื่องวันที่ให้หน่อยค่ะ พอดีทำคำนวณวันไม่ถูก |
|
 |
|
|
 |
 |
|
เขียนตั้งแต่ sql เลยก็ได้ครับ
DATE_ADD(Date_ServiceRequest, INTERVAL 7 DAY)
แต่ Date_ServiceRequest ต้องเป็น datetime หรือ date นะครับ
|
 |
 |
 |
 |
Date :
2010-12-28 21:58:47 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอาโค้ดตรงนี้ไปใส่เป็นเงื่อนไขใช่หรือป่าวค่ะ
|
 |
 |
 |
 |
Date :
2010-12-28 23:14:04 |
By :
SonakO |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ครับ ตรงคิวรี่เลย
select Date_ServiceRequest , DATE_ADD(Date_ServiceRequest, INTERVAL 7 DAY) as DueDate from table
ประมาณนี้ แล้วเอา Date_ServiceRequest กับ DueDate ไปใช้เลย อ้อจะใส่ DATE_FORMAT เข้าไปเพื่อจัด format เลยก็ได้นะ เพราะจะได้ไม่ต้องมาใช้ php จัดอีกที
|
 |
 |
 |
 |
Date :
2010-12-29 00:24:48 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|