Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8287273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:59:26+00:00 2026-06-08T11:59:26+00:00

I am using Classic ASP and have the following VB script code From8to14 =

  • 0

I am using Classic ASP and have the following VB script code

From8to14 = date-14
To8to14 = date-8

This sets the two variables.

For today, this would mean that

From8to14 = "13/07/2012"
To8to14 = "19/07/2012"

I then have a select query to SQL server, and I want to find any records where the DateMatched column is between (and including) these two dates

I have two conditions in the SQL when I declare it;

"AND INTRAY.DateMatched >= '"& Year(From8to14) &"-"& Month(From8to14) &"-"& Day(From8to14) &"' " & _
"AND INTRAY.DateMatched <= '"& Year(To8to14) &"-"& Month(To8to14) &"-"& Day(To8to14) &"' " & _

Now, this is not working properly because DateMatched column also includes a time in addition to the date, and I think the server is interepreting these dates as being at midnight at the start of that day ?

So, if a record has a DateMatched of “19/07/2012 17:41:22” then it is not being included.

How can I get around this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:59:28+00:00Added an answer on June 8, 2026 at 11:59 am

    Try this.

    "AND INTRAY.DateMatched >= dateadd(day, datediff(day, 0, getdate())-14, 0)" & _
    "AND INTRAY.DateMatched < dateadd(day, datediff(day, 0, getdate())-7, 0)" & _
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When writing parameterized queries in Classic ASP, I have been using the following syntax:
I am using Classic asp and SQL Server 2005. This is code that works
I've begun using ASPUnit to unit test my classic ASP code. This is all
I'm using classic asp, I have a drop down list that the user selects
i have a contact form sending itself to me by email using ASP classic,
I'm using classic ASP in my project. I want to merge two XMLs together.
In classic ASP, you can dump a recordset into an array using getRows(). This
I have some classic asp code that needs converting to asp.net. So far I
Its a simple login form that I have made using Classic ASP, where the
I am using classic ASP. I have a stylesheet that is loaded into RAM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.