convert access date Format() to French date , use of ORDER BY SQL

K

kapusta117

HELLO

I'm working in Access database .. i'm using this SQL query to extract dates
in English format below :

SELECT DISTINCT Format([Date Commande],"yyyy/mm") AS Expr1
FROM Relevé
GROUP BY Format([Date Commande],"yyyy/mm");

Result:
Expr1
2006/10
2006/11
2008/10
2008/11
2008/12
2009/01

AS YOU see i have the good order of my dates ..But when i m trying to have
the same result (Order)
in france format date ... my query doesnt work properly :

SELECT DISTINCT Format([Date Commande],"mm/yyyy") AS Expr1
FROM Relevé
GROUP BY Format([Date Commande],"mm/yyyy");

Result is :
Expr1
01/2009
10/2006
10/2008
11/2006
11/2008
12/2008

AS you see the order of date is not respected..
My question is how to convert date from english format to frensh format...IS
THERE ANY function or script to do this???.

Im beginner in ACCESS..So i m pleased to get a response.
THANK YOU.
 
K

Ken Snell \(MVP\)

Try this query:

SELECT DISTINCT Format([Date Commande],"mm/yyyy") AS Expr1
FROM Relevé
GROUP BY Format([Date Commande],"mm/yyyy")
ORDER BY Format([Date Commande],"yyyy/mm");
 
K

Ken Snell \(MVP\)

Sorry, error:

Try this query:

SELECT DISTINCT Format([Date Commande],"mm/yyyy") AS Expr1
FROM Relevé
GROUP BY Format([Date Commande],"mm/yyyy"),
Format([Date Commande],"yyyy/mm")
ORDER BY Format([Date Commande],"yyyy/mm");
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Ken Snell (MVP) said:
Try this query:

SELECT DISTINCT Format([Date Commande],"mm/yyyy") AS Expr1
FROM Relevé
GROUP BY Format([Date Commande],"mm/yyyy")
ORDER BY Format([Date Commande],"yyyy/mm");
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




kapusta117 said:
HELLO

I'm working in Access database .. i'm using this SQL query to extract
dates
in English format below :

SELECT DISTINCT Format([Date Commande],"yyyy/mm") AS Expr1
FROM Relevé
GROUP BY Format([Date Commande],"yyyy/mm");

Result:
Expr1
2006/10
2006/11
2008/10
2008/11
2008/12
2009/01

AS YOU see i have the good order of my dates ..But when i m trying to
have
the same result (Order)
in france format date ... my query doesnt work properly :

SELECT DISTINCT Format([Date Commande],"mm/yyyy") AS Expr1
FROM Relevé
GROUP BY Format([Date Commande],"mm/yyyy");

Result is :
Expr1
01/2009
10/2006
10/2008
11/2006
11/2008
12/2008

AS you see the order of date is not respected..
My question is how to convert date from english format to frensh
format...IS
THERE ANY function or script to do this???.

Im beginner in ACCESS..So i m pleased to get a response.
THANK YOU.
 
K

kapusta117

Hello
thanks you for response
I have juste this query :
SELECT DISTINCT Format([Date Commande],"mm/yyyy") AS Expr1
FROM Relevé
GROUP BY Format([Date Commande],"mm/yyyy"),
Format([Date Commande],"yyyy/mm")
ORDER BY Format([Date Commande],"yyyy/mm");


BUT I have an error telling me : THERE IS A CONFLICT between ORDER BY AND
DISTINCT

THANK YOU
 
K

kapusta117

YEAHHHHHH

I Tried your query without usind distinct it works .GREAT

SELECT Format([Date Commande],"mm/yyyy") AS Expr1
FROM Relevé
GROUP BY Format([Date Commande],"mm/yyyy"),
Format([Date Commande],"yyyy/mm")
ORDER BY Format([Date Commande],"yyyy/mm");


THANK YOU FOR HELPING ME .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top