Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Date comparison after format cdate

Posted on 2006-10-30
2
Medium Priority
?
538 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 1000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

722 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