Inconsistent SQL Server Query Behavior (Form Reference Criteria vs Hard Coded Date) (1 Viewer)

ions

Access User
Local time
Yesterday, 23:03
Joined
May 23, 2004
Messages
785
Hello MS Access Expert,

I am experiencing different query results when linked to SQL Server Tables, specifically, when I hard code criteria vs. a Form Reference. Note I don't experience this discrepancy when using Local MS Access Tables. I have attached the example database as a Zip.

I have now also added a video demonstrating the issue.

Thank you for your assistance and explanation for this inconsistent behavior.

1) Open the Database and Open frmA

2) Run qryCorrect and qryCorrectNOT which return the same Results because they are currently querying the local tables.

3) Migrate dbo_tblAccess and dbo_tblBAccess to SQL Server.

4) Run qryCorrect and qryCorrectNOT on the SQL Server Tables. You will now notice the Results are no longer the same.

SQL Server Incorrect Answer
1700159996290.png


Local Tables Correct Answer
1700159856947.png
 

Attachments

  • InconsistenQueryBehavior.zip
    42.1 KB · Views: 55
  • Explanation Video of Inconsistency.zip
    6.5 MB · Views: 50
Last edited:

AccessBlaster

Registered User.
Local time
Yesterday, 23:03
Joined
May 22, 2010
Messages
5,953
Birthday / BirthDay seems to be inconsistent between the two tables / queries, not sure to what effect it has, if any.
 

ions

Access User
Local time
Yesterday, 23:03
Joined
May 23, 2004
Messages
785
Birthday / BirthDay seems to be inconsistent between the two tables / queries, not sure to what effect it has, if any.
AccessBlaster if you mean the data within the two tables is not consistent that is by design to demonstrate the issue.
 

GPGeorge

Grover Park George
Local time
Yesterday, 23:03
Joined
Nov 25, 2004
Messages
1,867
AccessBlaster if you mean the data within the two tables is not consistent that is by design to demonstrate the issue.
Wait. The problem is that the two queries return inconsistent results.

You illustrate that by using inconsistent data for the two tables in the two queries?
 

ions

Access User
Local time
Yesterday, 23:03
Joined
May 23, 2004
Messages
785
Wait. The problem is that the two queries return inconsistent results.

You illustrate that by using inconsistent data for the two tables in the two queries?
Hi George,

I am demonstrating that when I use a Form Parameter (forms]![frmA]![dtmBirthday]) in the Where Clause on Access Tables everything works as expected but when I migrate the two tables to SQL Server I get a different result. I'll try to make a video.
 

ions

Access User
Local time
Yesterday, 23:03
Joined
May 23, 2004
Messages
785
Wait. The problem is that the two queries return inconsistent results.

You illustrate that by using inconsistent data for the two tables in the two queries?
Let me know if the video explains the issue clearly. I am very curious why this inconsistent behavior is occurring. The recording volume is very dim for some reason so please max out the volume. :)
 

Minty

AWF VIP
Local time
Today, 07:03
Joined
Jul 26, 2013
Messages
10,371
Put an Eval() around the form criteria.
 

Users who are viewing this thread

Top Bottom