Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MOD() vs % (sql-syntax)
Message
From
04/01/2005 02:27:54
 
 
To
03/01/2005 13:34:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00973817
Message ID:
00974005
Views:
20
Hi Tamar!

Thanks for help!

>>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
robert.oh.
Previous
Reply
Map
View

Click here to load this message in the networking platform