By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,140 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,140 IT Pros & Developers. It's quick & easy.

Comparaison dans une seule table

P: n/a
Bonsoir à tous,

Hypothèse : 1 table, 4 champs : VilleA, VilleB, CPA, CPB.

Objet : extraire toutes les lignes de la table dont les 2 premiers
chiffres de CPA sont égales aux 2 premiers chiffres de CPB.

Merci par avance pour vos suggestions.
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
While I can read French OK, I don't think I can write back in French, so
I hope English is OK with you.

Are your CPA fields number or text?

If text, try:

select * from LeTable where left(CPA,2) = left (CPB,2)

If number, you will need to convert the number to a string and then use
the LEFT function as above, perhaps like:

select * from LeTable where left(CStr(CPA),2) = left (CStr(CPB),2)

Hope this helps,

Anne

Arthemus wrote:
Bonsoir à tous,

Hypothèse : 1 table, 4 champs : VilleA, VilleB, CPA, CPB.

Objet : extraire toutes les lignes de la table dont les 2 premiers
chiffres de CPA sont égales aux 2 premiers chiffres de CPB.

Merci par avance pour vos suggestions.


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.