Ok here is the code,
....
USdate = Format(InputDate,"mm/dd/yyyy")
Sqlstring = " Select * from [Table1] where [datadate] = #"& USdate &"# "
....
Hope this help.
Thanes
--------- `
MS Access ปกติแล้วจะแปลวันที่ที่เราป้อนเข้าไปทาง Text box ต่างๆเป็น รูปแบบของ US ก่อนเอาไปประมวลผล ดังนั้นถ้าจะเลี่ยงปัญหานี้ ก็แค่แปลง รูปแบบของวันที่ที่ป้อนไปเป็น US format ก่อน เอาไปรวมใน SQL Statement แค่นั้น
ตัวอย่าง
USdate = Format(InputDate,"mm/dd/yyyy")
Sqlstring = " Select * from [Table1] where [datadate] = #"& USdate &"# "
....
หวังว่าจะช่วยได้ครับ
Thanes
No comments:
Post a Comment