Query yields diff results on diff plats

A

Ashish Nanda

I have a query and when i use this it gives me results

SELECT LEADMAN_LEADS.CUSTOMER, Date()-[DATE_AVAIL] AS
[tIME], LEADMAN_LEADS.SMAN
FROM LEADMAN_LEADS
WHERE (((Date()-[DATE_AVAIL])>'11') AND
((LEADMAN_LEADS.SMAN) Is Null));



showing 12 records where as when i run this query going to
SQL Backend then it gives me differnet results what cud be
the reason.
Is the date format diffenrent in them and that is whay or
what..?
Ashish Nanda
 
J

John Spencer (MVP)

In Access I'm surprised that you don't get an error message about mis-matched
types if you are using an mdb (and Jet). Remove the apostrophes from around the
11 and see if you get the expected result or at least the same results as in the
SQL backend.

SELECT LEADMAN_LEADS.CUSTOMER, Date()-[DATE_AVAIL] AS
[TIME], LEADMAN_LEADS.SMAN
FROM LEADMAN_LEADS
WHERE (((Date()-[DATE_AVAIL])>11) AND
((LEADMAN_LEADS.SMAN) Is Null));
 
A

Ashish Nanda

I actualy did try that but When i remove the apostrophes
it gives me an error about mismatched types.
What is the solution for it?
Best Regards,
Ashish Nanda



-----Original Message-----
In Access I'm surprised that you don't get an error message about mis-matched
types if you are using an mdb (and Jet). Remove the apostrophes from around the
11 and see if you get the expected result or at least the same results as in the
SQL backend.

SELECT LEADMAN_LEADS.CUSTOMER, Date()-[DATE_AVAIL] AS
[TIME], LEADMAN_LEADS.SMAN
FROM LEADMAN_LEADS
WHERE (((Date()-[DATE_AVAIL])>11) AND
((LEADMAN_LEADS.SMAN) Is Null));

Ashish said:
I have a query and when i use this it gives me results

SELECT LEADMAN_LEADS.CUSTOMER, Date()-[DATE_AVAIL] AS
[tIME], LEADMAN_LEADS.SMAN
FROM LEADMAN_LEADS
WHERE (((Date()-[DATE_AVAIL])>'11') AND
((LEADMAN_LEADS.SMAN) Is Null));

showing 12 records where as when i run this query going to
SQL Backend then it gives me differnet results what cud be
the reason.
Is the date format diffenrent in them and that is whay or
what..?
Ashish Nanda
.
 
J

John Spencer (MVP)

I'm stuck. Are you using JET or MSDE for the data in Access?

Ashish said:
I actualy did try that but When i remove the apostrophes
it gives me an error about mismatched types.
What is the solution for it?
Best Regards,
Ashish Nanda
-----Original Message-----
In Access I'm surprised that you don't get an error message about mis-matched
types if you are using an mdb (and Jet). Remove the apostrophes from around the
11 and see if you get the expected result or at least the same results as in the
SQL backend.

SELECT LEADMAN_LEADS.CUSTOMER, Date()-[DATE_AVAIL] AS
[TIME], LEADMAN_LEADS.SMAN
FROM LEADMAN_LEADS
WHERE (((Date()-[DATE_AVAIL])>11) AND
((LEADMAN_LEADS.SMAN) Is Null));

Ashish said:
I have a query and when i use this it gives me results

SELECT LEADMAN_LEADS.CUSTOMER, Date()-[DATE_AVAIL] AS
[tIME], LEADMAN_LEADS.SMAN
FROM LEADMAN_LEADS
WHERE (((Date()-[DATE_AVAIL])>'11') AND
((LEADMAN_LEADS.SMAN) Is Null));

showing 12 records where as when i run this query going to
SQL Backend then it gives me differnet results what cud be
the reason.
Is the date format diffenrent in them and that is whay or
what..?
Ashish Nanda
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top