Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hours/Minutes and using PAD in SQL
Message
From
12/12/2007 17:54:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
12/12/2007 16:22:33
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01275327
Message ID:
01275359
Views:
7
>If time is 11:15 (s_HH = 9 and s_MM = 15), I get "200712121115"
>If time is 9:15 (s_HH = 9 and s_MM = 15), I get "20071212915"
>
>What I want when the time is 9:15 is "200712120915"
>
>If I add PADL to it like this:
>
>
>	PADR(DTOS(s_Date) + PADL(ALLTRIM(STR(Schedule.s_HH * 100)), 2, '0') + ;
>		PADL(ALLTRIM(STR(Schedule.s_MM)), 2, '0'), 30, ' ')    AS Temp ;
>
>
>The result looks like this "200712129015"
>
>
>SELECT ;
>	PADR(DTOS(s_Date) + ALLTRIM(STR(Schedule.s_HH * 100 + Schedule.s_MM)), 30, ' ') AS Temp ;
>	FROM ( 'Schedule' ) ;
>	WHERE Schedule.SchedID == m.SchedID ;
>	INTO CURSOR Temp
>
>
>Any help appreciated...
select ttoc(dtot(s_Date) + s_HH * 3600 + s_MM * 60,1) as Temp ;
 FROM ( 'Schedule' ) ;
 WHERE SchedID == m.SchedID ;
 INTO CURSOR Temp
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