Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Just one of those days SELECT brain fart
Message
De
26/06/2006 14:23:15
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Just one of those days SELECT brain fart
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01131784
Message ID:
01131784
Vues:
51
SQL Server 2005
Table1:

field1 c(6)
field2 c(6)

SQL Server 2005
Table2:

field1 c(6) && same value as table1.field1 (case may or may not be the same)
field2 c(4) && filter condition this value must equal "CHTY" to get selected
field3 c(40) && same value as table2.field2 (case/len may or may not match)
field4 T && Datetime field

I want to select from table2 WHERE :

lower(alltrim(table2.field1))==lower(alltrim(table1.field1))
table2.field2 == "CHTY"
lower(alltrim(table2.field3))==lower(alltrim(table1.field2))

and then only the most recent 5 records in table2 based on the datetime field of table2.field4

I just can't seem to get it right today...

Any ideas?
TIA!
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform