User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 455,973 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,819 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser: Programming Forums
Views: 870 | Replies: 1
Reply
Join Date: Aug 2006
Posts: 999
Reputation: EnderX is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
EnderX EnderX is offline Offline
Posting Shark

Question regarding Access database sql.

  #1  
Nov 28th, 2007
I have been working on a program designed to read information from an Access database and display it on the screen. As my main development box doesn't have a copy of Access on it, I copied the data over to a PostgreSQL database and attempted to work from that. Now, having gotten the program working there, I was attempting to set it back up to receive data from the Access database.

My first SQL statement is throwing an error. The statement is "select distinct(deptCD) from sessionD where custID = '2' and dt >= '2004-1-01' and dt < '2004-3-31'". The error I am getting is 'Data type mismatch in criteria expression'. Would anyone please be willing to explain to me what it is I'm doing wrong with my statement?
"No trees were harmed in the production of this post. However, several electrons were severely inconvenienced."

Kumquat.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2007
Posts: 48
Reputation: CertGuard is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 3
CertGuard's Avatar
CertGuard CertGuard is offline Offline
Light Poster

Re: Question regarding Access database sql.

  #2  
Nov 28th, 2007
It all depends on the datatypes you have set in the database table, but I see two issues in your statement.

1. INT types do not have ' around them
2. DATES are surrounded by #

Try this:
select distinct(deptCD) from sessionD where custID = 2 and dt >= #2004-1-01# and dt < #2004-3-31#
--
Robert Williams
CEO, Founder
CertGuard
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS Access and FileMaker Pro Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MS Access and FileMaker Pro Forum

All times are GMT -4. The time now is 9:16 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC