Solved

Date comparison after format cdate

Posted on 2006-10-30
2
528 Views
Last Modified: 2008-03-17
I have a linked csv table that contains a date in the format of Oct 2006 and my link spec brings it in as text.
This query works ok:
SELECT Format(CDate([Month]),"yy/mm") AS Expr1
FROM tblPCGoogleReport;

this query works ok:
SELECT Format(CDate([Month]),"yy/mm") AS Expr1
FROM tblPCGoogleSLXMatch INNER JOIN tblPCGoogleReport ON tblPCGoogleSLXMatch.[Google Account Name] = tblPCGoogleReport.Account
ORDER BY Format(CDate([Month]),"yy/mm");

this query errors with data type mismatch:
SELECT Format(CDate([Month]),"yy/mm") AS Expr1
FROM tblPCGoogleReport
ORDER BY Format(CDate([Month]),"yy/mm");

I don't understand why I get an error in the 3rd query...any ideas?


0
Comment
Question by:avoorheis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 65

Accepted Solution

by:
rockiroads earned 250 total points
ID: 17835432
isnt the 3rd query the same as the 1st except u have ordering?

try ordering using columnn numbers
e.g.

SELECT Format(CDate([Month]),"yy/mm") AS Expr1
FROM tblPCGoogleReport
ORDER BY 1


only other thing is perhaps [Month] contains nulls or an invalid date
0
 

Author Comment

by:avoorheis
ID: 17835507
Silly me, for expecting to be sent clean data. Yes, there was a record that had bad data.

0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question