Date

Q:
in WebView (report) it’s displayed ok (e.g. “German”)…
A:
Dates in the Web Client are displayed in ANSI format so to be independent of the locale of the user.
The format is:
yyyy-mm-dd or yyyy-mm-dd hh:ii:ss
WebView report is generated server side using a dynamic server page which is why it can display an alternative date format to ANSI.


Q:
if I type:

Code:
a = timeofday(3)
b = timeofday(3)
c = b-a
? c...

I got the “string” 40534.37340526.850..
A:
Timeofday(4) returns the difference – the elapsed time between calling timeofday().
Timeofday() returns a character value.

Code:
a = timeofday(3)
? type("a")
C
? vartype(a)
C

Q:
What will be the date format of a Lianja table if record is inserted through Lianja ODBC ?
What is the default the century setting ?
A:
Lianja ODBC uses ISO format dates: YYYY-MM-DD; Century is ON.


Q:
I tried to update date field in my Lianja table from VFP 9.0 sp2 through Lianja ODBC and my date setting was YMD. The command is

Code:
? sqlexec(lnConnHandle, "update mytable set dated = {2015/05/14 09:29:02}")

The command is successfully executed but when I fetched data from Lianja table, it showed NULL is saved in my table.
If I save {2015-05-14 09:29:02} then the datetime value is stored perfectly. Is there a way to set date mark ‘-‘ to ‘/’ for Lianja ODBC ?
A:
Dates are set to ISO internally, so you would need to convert the value you are sending, e.g.
ctot(strtran(“2015/05/14 09:29:02″,”/”,”-“))


Q:
know how the syntax for dates with Visual FoxPro to ODBC lianja.
I’m trying several but do not work:

Code:
ffin=date()
myselect="SELECT * FROM FACTDIG WHERE FCHFACTURA<={?ffin}"
myselect="SELECT * FROM FACTDIG WHERE FCHFACTURA<=?ffin"
myselect="SELECT * FROM FACTDIG WHERE FCHFACTURA<={ts '01/29/2015 00:00:00'}"
if lnConnHandle > 0
sqlexec(lnConnHandle,myselect,"FACTDIG")
else 
messagebox("Sin Conexion","Error")
RETURN .F.
endif

A:

Code:
// TYPE("employees_calendar.eventstart") = "T" 
lc = SQLCONNECT("Lianja_Southwind")
m_datetime = TTOC(DATETIME(),1)
? SQLEXEC(lc,"select * from employees_calendar where eventstart < stot(?m_datetime)")
SQLDISCONNECT(lc)

// TYPE("orders.orderdate") = "D"
lc = SQLCONNECT("Lianja_Southwind")
m_date = DTOS(DATE())
? SQLEXEC(lc,"select * from orders where orderdate < stod(?m_date)")
SQLDISCONNECT(lc)

this is ok:

Code:
Xfini = DTOS(FINI)
Xffin = DTOS(FFIN)
myselect="SELECT * FROM FACTDIG WHERE FCHFACTURA>= stod(?XFINI) AND FCHFACTURA<= stod(?XFFIN) ORDER BY FACTDIG.FCHFACTURA"


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s