Specify data types in Access parameter queries
Takeaway: Are your Microsoft Access users having a difficult time getting a parameter query to work? The problem may be due to a mismatched data type. Learn how to change the data type for the query parameter.
When Microsoft Access users complain that a parameter query does not work, it may be that the Query Parameter's data type does not match the field's data type.
For example, to obtain a listing of the hours each employee worked for the week ending 05/20/2005, the user might enter 5/20/05. Since, by default, the data type for a query parameter is text, it would not match a Week Ending field whose data type is Date/Time and formatted as mm/dd/yyyy.
If you don't want your users to concern themselves with date formats, change the data type for the query parameter by following these steps:
- Open the Parameter Query in design view.
- Right-click the table pane.
- Select Parameters.
- Under Parameter, type Enter Week Ending Date (your parameter prompt without the brackets).
- Select Date/Time from the Data Type drop-down box.
- Click OK.
Now users can enter the week ending date in any format and still obtain the correct results.
Help users increase productivity by automatically signing up for TechRepublic's free Microsoft Office Suite newsletter, featuring Word, Excel, and Access tips, delivered each Wednesday.
Print/View all Posts Comments on this article
SponsoredWhite Papers, Webcasts, and Downloads
- Demo: Need Disk Space? IBM DB2 9 Compression Demo IBM
- Advances in Data Warehouse Performance: I/O Elimination in DB2 IBM
- Sprint DataLink for Wireless WAN Fact Sheet Sprint
- Next Generation Mobility Now Sprint
- Sprint IPVoice Connect Fact Sheet Sprint
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET

