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

  • SEARCH
  • Home
  • 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 8712531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:07:44+00:00 2026-06-13T05:07:44+00:00

I am working on this Access 2002 database. It uses linked servers to SQL

  • 0

I am working on this Access 2002 database. It uses linked servers to SQL Server 2008. I am having a problem where in load of the main form it does a DLookup and looks at a date.

EndDate = Nz(DLookup("End_Date", "Employee", "EmpID= " & EmpID & " AND End_Date IS NOT NULL AND End_Date < #" & Now & "#"), "")

Now this works fine in Access 2002, but in Access 2010 I get the:
Conversion failed when converting date and/or time from character string

Here’s the kicker though, it works in Access 2010 for one user: myself. No other users does it work for and also other installations with Windows 7 and the Access 2010 Runtime work fine. On the same machine the MDB works correctly also. If I replace the Pound signs with single quotes like in SQL Server it runs fine on the 2010 machine but no longer works on 2002 (duh).

It’s just been wracking my brain and normally I have been able to get it to work by uninstalling all of Office and then reinstalling and making sure the SP1 for the Access Runtime was installed last.

  • 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-13T05:07:45+00:00Added an answer on June 13, 2026 at 5:07 am

    Instead of transforming the value of Now() to a string in your DLookup, just let the db engine determine Now() for itself.

    EndDate = Nz(DLookup("End_Date", "Employee", _
    "EmpID= " & EmpID & " AND End_Date IS NOT NULL AND End_Date < Now()"), "")
    

    That approach does not depend on a conversion between Date/Time and string and back again, so will avoid the problem you reported.

    If you want to examine how the original DLookup gave different results, try something like this on the different machines:

    Dim strCriteria As String
    strCriteria = "EmpID= " & EmpID & " AND End_Date IS NOT NULL" & _
        " AND End_Date < #" & Now & "#"
    Debug.Print "strCriteria: " & strCriteria
    EndDate = Nz(DLookup("End_Date", "Employee", strCriteria), "")
    

    After running that code, go to the Immediate window (Crtl+g) and inspect the value of strCriteria.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on moving a database from MS Access to sql server. To
I am currently working on a VB.NET desktop application that uses .mdb (Access) database
i don't face this problem while working on localhost only when I access the
I'm working on a sample i found on this site: http://kevinmusselman.com/blog/2009/02/access-webcam-with-flash/ it captures the
I have used code like this: http://msdn.microsoft.com/en-us/library/dw70f090.aspx to access database before when working in
Had this working; at one stage. The problem is the following text is now
I am working on this problem for two days and this is driving me
The scenario I have access to this old linux server, that no longer receives
I'm working on this PHP code collaboration and it seems that some people access
I have a program that uses a Microsoft Access database for its back-end. I

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.