Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query Help Please
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00780728
Message ID:
00780814
Views:
9
Yuri,

This is an existing project. the field resp_due is date type not datetime.

so, is there a way i can get the number of days with the date datatype.

I am attching the code.
*************************
local lcSource,cuList2,temp

IF NOT USED("userproj")
USE mDataPath+"userproj" IN 0
ENDIF
select userproj
CursorSetProp("buffering",5,"userproj")


lcSource = "SELECT project_no,workpkg_no ;
FROM userproj ;
where DELETED() = .f. and userproj.userid = guser ;
into cursor lcSource"

WITH thisform.list1
.RowSourceType = 3 && SQL Statement
.RowSource = lcSource
.Requery()
.refresh()
.setfocus()
ENDWITH

ctoday = date()
CREATE CURSOR cuList2 (project_no C(3), workpkg_no C(5),sub_title C(150), Days N(3))
for n = 1 to thisform.list1.listcount
col1 = thisform.list1.listitem(n, 1)
col2 = thisform.list1.listitem(n,2)
select project_no,workpkg_no,sub_title,(ctoday - ttod(resp_due)) as days from sub ;
where project_no = col1 and workpkg_no = col2 and empty(to_cont) ;
and resp_due <= ctoday into cursor temp
select cuList2
append from dbf("temp")
use in select("temp")
endfor


WITH thisform.list2
.RowSourceType = 2 && Alias
.RowSource = "cuList2"
.Requery()
.refresh()
.setfocus()
ENDWITH
*****************************

Thank you.
Previous
Reply
Map
View

Click here to load this message in the networking platform