SQL Server between and

Source: Internet
Author: User

1, with between and query time

SELECT * FROM dbo. CheckInOut where userid= ' 17953 ' and checktime between ' 2013-03-16 ' and ' 2013-03-21 '

The database has March 31 of data records, but with between and this writing is not found out

You can find it in this form.

SELECT * FROM dbo. CheckInOut where userid= ' 17953 ' and checktime between ' 2013-03-16 ' and DATEADD (day,1, ' 2013-03-22 ')

2, two SQL statements results are not the same, the first one does not query the results, the second can query the results, you should put small numbers in front

SELECT *from t_portgrant where stageid=73 and portprice between and 100
SELECT *from t_portgrant where stageid=73 and portprice between and 270

SQL Server between and

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.