Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set relationship
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01593576
Message ID:
01593689
Views:
30
>>>Where do you get such numbers? In Excel?
>>
>>For indexing, I created a numeric field called mindex and stuffed it with all the date data: year, month, day, hour, minutes, like: 201211011711
>>Now, when I try to use mindex in an SQL expression, if I want to strip off the hours or minutes, I first have to do a
>>str(mindex) and that returns in scientific notation because
>>
>>If nExpression has Numeric or Float type, and nLength is less than the number of digits in nExpression, and , STR( ) returns a value using scientific notation.
>
>You can use
>
>LEFT(CAST mIndex as C(12)), 10) as YearMonthDayHour
>
>Or just use the second parameter in STR, e.g.
>
>STR(mIndex, 12)
>
>Also, if you want your number to remain number, but just without minutes part, use

LEFT(CAST (mIndex as C(12)), 10); Thanks
>
>floor(mIndex / 100) or CAST(mIndex/100 as I)
Previous
Reply
Map
View

Click here to load this message in the networking platform