Access SQL query 샘플들

DateTime을 Date / Time으로 분리

SELECT 
  REGDATE,
  Int(REGDATE) AS ONLY_DATE,
  REGDATE-Int(REGDATE) AS ONLY_TIME
FROM 
  WeatherData;

http://webcheatsheet.com/SQL/access_functions/dateadd.php

http://www.techonthenet.com/access/functions/date/dateadd.php

DateAdd function

DateAdd( interval, number, date)

interval :
yyyy Year
q Quarter
m Month
y Day of the year
d Day
w Weekday
ww Week
h Hour
n Minute
s Second

date :
now(), regdate... etc

dateadd("n", 10, '2012-01-01 01:50')

 

Leave a Reply

Your email address will not be published. Required fields are marked *

 characters available