Hi,
I'm having issues in comparing datetime coming from a remote view. Backend is remote MSSQL. VFP8sp2. Attached is a screenshot showing outputs to the screen, and easy to follow.
The sql data is stored as datetime2(0). When eching the result of ?myUser.ExpireTime I get '2021-02-09 04:58:42' and is later confirmed as character type by echo the result of ?Type('myUser.ExpireTime')
Issuing ?Ctot(myUser.ExpireTime) echos ' / / : : ' and I believe that the issue is somehow here, as I would expect it to have a non empty value.
When evaluating the datetime from the remote view against plain ole datetime(), the results do not change as the screen echoing clearly shown.
What is going on? Any suggesions?
Thanks, Stanley
I'm having issues in comparing datetime coming from a remote view. Backend is remote MSSQL. VFP8sp2. Attached is a screenshot showing outputs to the screen, and easy to follow.
The sql data is stored as datetime2(0). When eching the result of ?myUser.ExpireTime I get '2021-02-09 04:58:42' and is later confirmed as character type by echo the result of ?Type('myUser.ExpireTime')
Issuing ?Ctot(myUser.ExpireTime) echos ' / / : : ' and I believe that the issue is somehow here, as I would expect it to have a non empty value.
When evaluating the datetime from the remote view against plain ole datetime(), the results do not change as the screen echoing clearly shown.
What is going on? Any suggesions?
Thanks, Stanley
Code:
CREATE SQL VIEW myUser REMOTE CONNECTION DeedroomConn AS SELECT * FROM UserSubscription
Use 'myUser'
Select 'myUser'
Set Filter To
Go Top
Set Hours To 24
Set Century On
Set Date AMERICAN &&USA
*CLEAR
*Set Filter To myUser.ExpireTime > Ttoc(Datetime(),3) .;
*And. myUser.Userid = 'TU0001KY131'
? myUser.ExpireTime
? Ctot(myUser.ExpireTime)
? Type('myUser.ExpireTime')
? Datetime()
? Ttoc(Datetime()) < myUser.ExpireTime
? Ttoc(Datetime(),1) < myUser.ExpireTime
? Ttoc(Datetime(),2) < myUser.ExpireTime
? Ttoc(Datetime(),3) < myUser.ExpireTime
? Ttoc(Datetime()) > '2021-02-09 04:58:01'