ASP ACCESS Date Action Statement summary by STABX_ application tips

Source: Internet
Author: User
Tags time and date
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"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.