Copy Code code as follows:
13.5.1 list the data for one day, last week
SELECT distinct DateAndTime
From Ctdate_by_query_date
WHERE DateAndTime between ((#2006 -5-15#+ (Weekday (2006-5-15) -7))-6) and (#2006 -5-15#-7) +weekday (2006-5-15)
Sql= "SELECT distinct dateandtime from ctarticle WHERE dateandtime between (#" &date& "#+ (Weekday (" &date & ")" &norp& "7)"-6) and (# "&date&" # "&norp&" 7) +weekday ("&date&") "
13.5 Query day, all days of the week of data
SELECT *
From Ctdate_by_query_date
WHERE DateAndTime between ((#2006 -5-15#+weekday (2006-5-15))-6) and #2006 -5-15#+weekday (2006-5-15)
13.4 Query a time period
SELECT *
From Ctdate_by_query_date
WHERE DateAndTime between #2006 -5-1# and #2006 -5-30#
13.3.2 list years of different years, and do not have the same
SELECT distinct year (dateandtime) from ctarticle
Results such as:
Expr1000
2000
2003
2004
2005
2006
13.3.1 List one day, the first record of the previous year
SELECT top 1 DateAndTime from ctarticle where year (dateandtime) = (2006)-1
Sql= "SELECT top 1 dateandtime from ctarticle where year (dateandtime) = (Year (# &date&" #) "&norp
13.3 list data for a certain year
Sql= "SELECT * from Ctdate_by_query_date where year (dateandtime) =" &year (rqqdt_) & "ORDER BY dateandtime Desc"
13.2.1 find the first record in the previous month
SELECT top 1 DateAndTime from ctarticle where year (dateandtime) =year (#2006 -5-28#) and month (DateAndTime) =month (# 2006-5-28#)-1
13.2 listing data for a January
Sql= "SELECT * from Ctdate_by_query_date where year (dateandtime) =" &year (rqqdt_) & "and month (dateandtime) =" &month (rqqdt_) & "ORDER BY dateandtime Desc"
13.1 list data for one day
Sql= "SELECT * from Ctdate_by_query_date where dateandtime=#" &rqqdt_& "# ORDER BY A.articleid Desc"
13. Time and date
Example one: List the data for the day
Sql= "SELECT * from Ctdate_by_query_date where dateandtime=date () Order BY A.articleid Desc"