กระทู้เก่าบอร์ด อ.Yeadram
        
           1,492   3		  
          
					  
		    URL.หัวข้อ / 
		    URL
        
        show ค่าล่าสุด      
    
      เราต้องการ show ข้อมูลที่รับเข้ามาใน table โดยให้ show ค่าล่าสุดที่รับเข้ามาใน table ถ้าเช็คจากเวลาต้องทำอย่างไงบ้างค่ะ    
    
  
				3 Reply in this Topic. Dispaly 1  pages and you are on page number 1 
				
        
    2 @R10944    
        
  
      ต้องขอโทษด้วยคะ ข้อมูลเป็นแบบนี้คะ
date target plan dif
20110909 08:05:00 am 1000 800 -200
20110909 08:08:00 am 1000 900 -100
20110909 08:05:00 pm 1000 950 -50
ต้องการ show ข้อมูลล่าสุดของช่วง am และ pm เพราะฉนั้น ในข้อมูลที่ให้มาจะ show 2 record
date target plan dif
20110909 08:08:00 am 1000 900 -100
20110909 08:05:00 pm 1000 950 -50
และต้องการให้ช่วงเวลา am เป็น dayshift ส่วน pm ให้เป็น nightshift จะต้องทำอย่างไงบ้างคะ
    
  date target plan dif
20110909 08:05:00 am 1000 800 -200
20110909 08:08:00 am 1000 900 -100
20110909 08:05:00 pm 1000 950 -50
ต้องการ show ข้อมูลล่าสุดของช่วง am และ pm เพราะฉนั้น ในข้อมูลที่ให้มาจะ show 2 record
date target plan dif
20110909 08:08:00 am 1000 900 -100
20110909 08:05:00 pm 1000 950 -50
และต้องการให้ช่วงเวลา am เป็น dayshift ส่วน pm ให้เป็น nightshift จะต้องทำอย่างไงบ้างคะ
        
    3 @R10974    
        
    
      ถ้าเป็น query 
(
Select * From YourTable Where YourDateTime =
Select Max(datetime) From YourTable Where
)
Union
(
Select * From YourTable Where YourDateTime =
Select Max(datetime) From YourTable Where
)
    
    
  (
Select * From YourTable Where YourDateTime =
Select Max(datetime) From YourTable Where
)
Union
(
Select * From YourTable Where YourDateTime =
Select Max(datetime) From YourTable Where
)
      Time: 0.0690s
    
      
		
- ใช้ dlookup() ระบุเงื่อนไข
- ใช้คิวรี่
--- select top 1 ...... from ...... order by ..... desc;
--- select a, b, ..., last(datetime) from .... group by a, b, ....,
คำถามบรรทัดเดียวครับ ตอบยาก