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

critère d'une requête fesant référence à une valeur dans une table qui change...

P: n/a
Bonjour,

je veux faire une requête qui selectionne seulement les mots qui
contiennent disons "afe"

Le problème est que je voudrais que cette partie de mot provienne
d'une table qui change de fois en fois.

Dans mes critères j'inscris : comme "*afe*" et ca fonctionne
parfaitement.
Mais, lorsque j'inscris: comme "*[tableX].[colonneX]*" rien ne
fonctionne. Vous avez une idée de la syntaxe à utilisée ? j'ai
esseyé une panoplie d'expressions sans succès.

mon code slq est le suivant :

slqtext = "SELECT [total_installs].[Unité Administrative] From
total_installs, uachoisi WHERE ((([total_installs].[Unité
Administrative])='*afe*'));" <------ celui la fonctionne

des idées ?

Merci à l'avance

Aug 3 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 3 Aug 2006 12:57:17 -0700, "icony" <al**********@hotmail.com>
wrote:

Ici on parle Anglais.

Wildcards on a field name are not allowed, only on a value.
Also, if you're using wildcards, you typically want to use the LIKE
keyword.
Bad:
select * from mytable where myfield* = 'abc'
Good:
select * from mytable where myfield LIKE 'abc*'

-Tom.

>Bonjour,

je veux faire une requête qui selectionne seulement les mots qui
contiennent disons "afe"

Le problème est que je voudrais que cette partie de mot provienne
d'une table qui change de fois en fois.

Dans mes critères j'inscris : comme "*afe*" et ca fonctionne
parfaitement.
Mais, lorsque j'inscris: comme "*[tableX].[colonneX]*" rien ne
fonctionne. Vous avez une idée de la syntaxe à utilisée ? j'ai
esseyé une panoplie d'expressions sans succès.

mon code slq est le suivant :

slqtext = "SELECT [total_installs].[Unité Administrative] From
total_installs, uachoisi WHERE ((([total_installs].[Unité
Administrative])='*afe*'));" <------ celui la fonctionne

des idées ?

Merci à l'avance
Aug 4 '06 #2

P: n/a
Thank you Tom,

I didnt realize me writing in french would get people pissed off.
I also posted my question in english and i got a response. In fact, its
true that you cant use wildcards but i used a string that changes in my
code. At first i was trying to put the combo1.text in a table and then
use that table...bad idea hehe.

here's what a used :

dim str1 as string
.....
str1 = combo1.text

myslqtxt = "SELECT " _
& "[total_installs].[Unité Administrative] " _
& "From total_installs, uachoisi " _
& "WHERE " _
& "((([total_installs].[Unité Administrative])LIKE'" & "*" & str1 &
"*" & "'))"
.....
thx again

Alex

Aug 4 '06 #3

P: n/a
Thank you Tom,

I didnt realize me writing in french would get people pissed off.
I also posted my question in english and i got a response. In fact, its
true that you cant use wildcards but i used a string that changes in my
code. At first i was trying to put the combo1.text in a table and then
use that table...bad idea hehe.

here's what a used :

dim str1 as string
.....
str1 = combo1.text

myslqtxt = "SELECT " _
& "[total_installs].[Unité Administrative] " _
& "From total_installs, uachoisi " _
& "WHERE " _
& "((([total_installs].[Unité Administrative])LIKE'" & "*" & str1 &
"*" & "'))"
.....
thx again

Alex

Aug 4 '06 #4

P: n/a
"icony" <al**********@hotmail.comwrote in
news:11**********************@i42g2000cwa.googlegr oups.com:
I didnt realize me writing in french would get people pissed off.
It doesn't piss me off at all, but since I don't read much French, I
couldn't help out. I don't believe the newsgroup charter has any
restrictions on posting language, but in my experience only posts in
English and German get responses (I read German, as do a couple of
other regulars, as well as any number of actual Germans who read the
newsgroup). In a perfect world we could all post in our native
languages and all get the same response, but in reality, it's got to
be English to maximize your chances of a response.

But it doesn't have to be anything more than servicable English. I,
for one, don't hold anything against people posting in a non-native
language, as if I were to have to post in German, I'd be laughed out
of the room by any native speakers!

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Aug 4 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.