dbTalk Databases Forums  

access2007/sql2005 query problem

comp.databases.ms-access comp.databases.ms-access


Discuss access2007/sql2005 query problem in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Roger
 
Posts: n/a

Default access2007/sql2005 query problem - 09-23-2010 , 03:20 PM






I've got a sql table that is linked into access2007 (latest service
packs, etc)
tblHoliday
holidayId pk
branch text
holidayDate date/time

there is a record where branch is null and holidayDate is
#12/27/2010#

this query works
SELECT branch, holidayDate FROM tblHoliday WHERE holidayDate =
#12/27/2010#

this one doesn't
SELECT branch FROM tblHoliday WHERE holidayDate = #12/27/2010#

yet it works for earlier dates in the table

does anyone have an explanation ?

Reply With Quote
  #2  
Old   
John Spencer
 
Posts: n/a

Default Re: access2007/sql2005 query problem - 09-24-2010 , 12:01 PM






It doesn't work is not very descriptive of what is happening.

Are you saying that you don't get any row back with the second query or do you
get an error or do you get the wrong results or ...?

Does the following work and return a number other than zero?
SELECT Count(*) as RecordsReturned
FROM tblHoliday
WHERE holidayDate = #12/27/2010#

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Roger wrote:
Quote:
I've got a sql table that is linked into access2007 (latest service
packs, etc)
tblHoliday
holidayId pk
branch text
holidayDate date/time

there is a record where branch is null and holidayDate is
#12/27/2010#

this query works
SELECT branch, holidayDate FROM tblHoliday WHERE holidayDate =
#12/27/2010#

this one doesn't
SELECT branch FROM tblHoliday WHERE holidayDate = #12/27/2010#

yet it works for earlier dates in the table

does anyone have an explanation ?

Reply With Quote
  #3  
Old   
David W. Fenton
 
Posts: n/a

Default Re: access2007/sql2005 query problem - 09-24-2010 , 01:12 PM



Roger <lesperancer (AT) natpro (DOT) com> wrote in
news:da173c22-c249-4b5d-a492-a293bfcc75d1 (AT) w4g2000vbh (DOT) googlegroups.com
:

Quote:
this one doesn't
SELECT branch FROM tblHoliday WHERE holidayDate = #12/27/2010#
What about:

SELECT tblHoliday.branch
FROM tblHoliday
WHERE tblHoliday.holidayDate = #12/27/2010#

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.