Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MOD() vs % (sql-syntax)
Message
De
03/01/2005 13:34:05
 
 
À
03/01/2005 10:46:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
00973817
Message ID:
00973889
Vues:
26
>VFP8:
>MOD(10-12,12) = 10
>
>SQL:
>(10-12) % 12 = -2
>
>I need to use Modulo in my sql-syntax - what have I done wrong???
>

What you've really done wrong is tried to use modulo with a negative number. That operation isn't defined mathematically for negative numbers. However, as you've learned, programming languages let you do it anyway. It's not surprising, though, that two different engines (I'm assuming that by "SQL," you mean SQL Server, not VFP's SQL engine) give you two different results.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform