Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Program works ok in VFP but not from explorer
Message
De
28/10/2015 10:43:30
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01626541
Message ID:
01626550
Vues:
47
>>>My program has the following code
>>>
>>>datexo=LEFT(datx,2)+"/"+monato+"/20"+SUBSTR(datx,8,2)+" "+SUBSTR(datx,11,6)+":00"
>>>
>>>which results in a data like 28/10/2015 10:30:00 still in character format
>>>
>>>its then appended into a date time field
>>>
>>>This works fine as long as I run it from inside VFP on all machines
>>>
>>>But if I run it as a scheduled service or from Explorer on 1 machine the date time field is blank although the character format is the same 28/10/2015 10:30:00
>>>
>>>What is the problem?
>>>
>>
>>I don't know what the specific problem is, but there's no reason to build a datetime that way. Use the DATETIME() function and then, you're not dependent on the date format or anything else.
>>
>>
>>tDateTime = DATETIME(nYear, nMonth, nDay, nHour, nMinute, nSecond)
>>
>>
>>I'll leave it to you to figure out how to get those values from what you have in hand.
>>
>>Tamar
>
>I have tried the fields in the expression as characters and then as numeric ant it fails both times - should they be character or numeric?

Colin,

if you have a VFP function or command. Try on comand window
HELP command
for your problem
HELP DATETIME
Usualy there comes a window that gives a description in english. It shows the sense of the comand, parameters with there type and use and return values and side effects if any. On VFPX there is a more recent version that fixes some stuff, but in general it works as is.
This is called a help system. It gives answers for simple questions.

And please learn to use the tags like pre in UniversalThread. If you do not know how, just try to reply to this message. Look at my lines, there are two sections wrapped in pre tags that made code formated. It's very simple. Also there is a place where some letters are bold.

Protip:
in DATETIME(nYear, nMonth, nDay, nHour, nMinute, nSecond) from above the
n indicates the datatype. This is numeric.
This is called hungarian notation.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform