Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving date and time and getting date
Message
From
01/03/2010 07:57:07
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
 
 
To
01/03/2010 06:28:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
01450712
Message ID:
01451730
Views:
34
>>I read and understand what Naomi said. I just wanted to cut short. Actually I used this way to get today:
>>
>>xfirstdate=Datetime(Year(Date()),Month(Date()),Day(Date())+1,0,0,0)
>>xlastdate=Datetime(Year(Date()),Month(Date()),Day(Date())+1,0,0,0)-1
>>
>>Boris, You are a bit wrong. It's not 937, 997: I read about 997 http://www.karaszi.com/SQLServer/info_datetime.asp :))
>>And a thing about your new photo. I cannot see your face at that photo. Maybe you have to zoom it.
>
>IMHO you are doing it extrememly wrong. It would miss almost all the records but include maybe a few that occurred in the last second to midnight. It is simply:
>
>
xFirstDate = date()
>xLastDate = date() + 1
>
>... where ... myDateTime >= ?m.xFirstDate and myDateTime < ?m.xLastDate
>
>or:
>
theDate = date()
>... where ... myDateTime >= ?m.theDate and myDateTime < ?m.theDate + 1
>
>
>and as I said before you can use indexes on computed columns to benefit indexes on 'expressions'. Depending on your searching needs you might even benefit from partitioning the table and the index.
>
>PS: Borislav was right you understood what he is saying wrong. While the milliseconds sensitivity in SQL server is 3 milliseconds, he meant you would miss any records after 23:59:59.000. In other words you are leaving this window open:
>
>23:59:59.000 to 24:00:00.000
>
>Cetin

I thought VFP consider milliseconds too with -1 from tomorrow. If it doesn't consider when xlastdate, it doesn't consider when saving my records too. So there isn't any problem.

Anyway I have to accept your method more simply mine... :) I'll use yours.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform