Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT-SQL, DATE() and DATETIME()
Message
From
31/05/2003 12:40:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
31/05/2003 11:32:25
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00794631
Message ID:
00794883
Views:
11
>Hi Cetin,
>
>for me GETDATE(),NEWID() is good, but RAND() no.
>
>Example:
>
>On MSQL:
>
>Table ( id INT IDENTITY, Name VARCHAR(50), dateStart DATETIME )
>
>no index on dateStart and 1 Million of rows.
>
>I want 5, flat random id, valid today ( i can insert future valid name ).
>
>The query run at 23:59:59.5 ( i am a night worker )
>
>SELECT TOP 5 * FROM Table WHERE dateStart< =GETDATE() AND id=CONVERT(INT,RAND(1)*1000000)
>
>GETDATE() is good but RAND() no;
>convert NEWID() to integer flat random is not simple.
>
>Fabio

I surrender. Having a hard time to understand.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform