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 8259751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:56:10+00:00 2026-06-08T02:56:10+00:00

I am working on an old software that uses a .mdb database. I have

  • 0

I am working on an old software that uses a .mdb database.

I have succeeded in setting up a connection to the database and i can run sql queries just fine when it comes to preprogrammed queries like this one :

SELECT COUNT(*) AS test FROM shifts WHERE EmpId = '2' AND DateOpen <= '3/28/2007'

Moving on, i replaced the 2 with an expression depending on the user selection like so

Employees(employe.SelectedIndex)

This worked fine too.

Now, when i tried to replace the date with startDate.Value.ToShortDateString i started facing many conversion problems and i finally had something that worked so my where clause became like this :

WHERE EmpId = '" & Employees(employe.SelectedIndex) & "' AND DateDiff('d', DateOpen, '" & endDate.Value.ToShortDateString & "') <= 0

Now i chose the same date that was in the query above, the query runs with no problems but surprisingly i got a null result, which doesn’t make any sense to me because the query with the values already there returned a count of 2.

I used some debugging output to make sure the query is properly being generated and i got the same query as above when i select the date.

If you have any idea why this is not working or have any hints on the proper way to do it, i would appreciate all your input.

Thanks in advance

  • 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-08T02:56:11+00:00Added an answer on June 8, 2026 at 2:56 am

    I ended up using BETWEEN in the query, and with params the query works like a charm!

    WHERE (DateOpen BETWEEN @DStart AND @DEnd)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with an old sql server 2000 database, mixing some of it's information
I'm working on some old(ish) software in PHP that maintains a $cache array to
I have an old software that written in VB6 with infragistics SSActiveToolBars control (ActiveThreedPlus).
I'm working with some very old, monolithic software that is basically a heavily customized
I am working on old sites and updating the deprecated php functions. I have
I'm working on old code that relies heavily on the exception specifications behavior described
I am working on a project that uses WIX to install an application. One
I am working on a project form my company. We have an application that
I'm working on an old web application my company uses to create surveys. I
I am working with an SVN repository that is over 3 years old, contains

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.