•
•
•
•
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
![]() |
•
•
Join Date: Aug 2006
Posts: 999
Reputation:
Rep Power: 4
Solved Threads: 1
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?
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.
Kumquat.
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:
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
Robert Williams
CEO, Founder
CertGuard
![]() |
•
•
•
•
•
•
•
•
DaniWeb MS Access and FileMaker Pro Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access ajax apple asp avatar backup breach code combo computing core daniweb data data protection database design developer development dropdownlist government hacker ibm ip mac medicine microshaft microsoft module ms msdn net news normalization office pro processor reuse security server software sql survey vista web
- Writing to an Access Database (Visual Basic 4 / 5 / 6)
- Beginning question about coping/moving a sql database (MS SQL)
- radio button ASP question?? (ASP)
- Manipulating A Database (C#)
- question about connecting odbc to sql through php script (PHP)
- Rookie Question (C#)
- MySQL, SQL conglutinate date items (MySQL)
- ASP and SQL ? (MS SQL)
Other Threads in the MS Access and FileMaker Pro Forum
- Previous Thread: Automate Importing
- Next Thread: Seeking rudamentary advice


Linear Mode