![]() |
#1
|
|||
|
|||
![]()
I have a firedac query that returns a column C_08 but I want to add a new column not in the table but just on the fly of the query.
I am trying to figure out how to add a new column D_08 and to assign the value from C_08 to D_08. It has to be calculated. this is related to prior timestamp/datetime fieldtype question. C_08 is timestamp and the component doesn't work on it so I need to create the new column D_08 as a datetime field type and set its value to the same as C_08 I added it as a InternalCalc and set the defaultexpression to C_08. compiles but my new column is always null What am I missing. |
#2
|
|||
|
|||
![]() Code:
SELECT Convert(DATETIME, [C_08]) as [D_08] FROM [yourtable] |
#3
|
|||
|
|||
![]()
It has to be a calculated field because I am using an Access database and when I open the query and check the field type it is timestamp and if in the query I use the CDATE command to create my new field it still comes out as timestamp. the calculated field comes out as datetime but is null.
this is a big round robin type of setup. a firedac query to a datasetprovider to a clientdataset. when I add the field to the FDQuery it gets set properly and is a datetime field. but in the clientdataset the field is null. if I add it the fdquery and clientdataset then I get an error of name not unique. when I add it only to the clientdataset it is null. I tried using maprules of firedac but it made no difference. it seems that timestamp is a datetime so no datatype conversion changes are made in the query. So when playing around with the added field it says that it is a datetime but I just cant seem to get the clientdataset field to have a value. |
![]() |
Thread Tools | |
Display Modes | |
|
|