i am having trouble converting a date for SQL. bear with me, i'm no programmer and sql is way outside my comfort zone.
firstly the UX is bound to a .dbf. in the table is a field where the user enters a value for 'number of months' this determines how long a fixed rate will last for a mortgage (thought this might help).
i then convert this to an approx date with this (doesn't need to be exact) , which has been working fine.
i now want to write the value of VRDate to a SQL table which is not bound to the UX. i have done this with other dates ok but having trouble with this one, i am thinking because it has already been calculated as above, not sure.
this works ok on another date value which get the data from the bound UX
this doesnt work
i do then need to sort out a couple more fields related to this field which so far are as follows, they may work as is, not sure so thought i'd include it here.
im almost there, just need to get this final bit sorted out. thanks for looking.
firstly the UX is bound to a .dbf. in the table is a field where the user enters a value for 'number of months' this determines how long a fixed rate will last for a mortgage (thought this might help).
i then convert this to an approx date with this (doesn't need to be exact) , which has been working fine.
Code:
if convert_type(ds.prod_ratemonths, "N") > 0 then dim vdate as d dim vmonths as n dim vrdate as d vdate=date() vmonths=ds.prod_ratemonths vrdate=addmonths(vdate,vmonths -2)
this works ok on another date value which get the data from the bound UX
Code:
dim ds as p = e.datasubmitted dim prodexch as C = ds.prod_dateonrisk args.set("prodexch", convert_type(prodexch,"D"))
Code:
dim reviewdate as C = VRDate - [COLOR="#FF0000"]produces no error executes .dbf code ok but doesnt write the record to the sql table[/COLOR] dim reviewdate as D = VRDate - [COLOR="#FF0000"]produces an error can't convert type c to d - doesnt execute any of the code[/COLOR] args.set("reviewdate", convert_type(reviewdate,"D"))
Code:
dim review3 as D = VRDate-30 dim review4 as D = VRDate-60 dim review6 as D = VRDate-120 dim prodenddate as D = VRdate + 60
im almost there, just need to get this final bit sorted out. thanks for looking.
Comment