On the datapipeline, make sure that the TppField object (dbl-click on pipeline at design time to see a list of our field objects) defined for this datafield from your dataset has a field type set to Date. Then you can select the proper date format from our list of display formats in the report designer by right clicking over the dbText. Then the proper day should appear in the report for the dbText when you print the integer field as a date field value.
Thank you for your reply. I'm afraid this doesn't seem to work. The database is Pervasive SQL 2000i [Btrieve] and I have to define this field as 'Integer' in the DDFs. Some users use MS Access with Pass-Through Queries to access the data, and if I define the field as 'Date' an ODBC call fails - Invalid Date. We have to use the CDate() function in an ordinary query to get the correct date to display. Probably because it uses VB, which understands this date format.
Back to Delphi and RB - if I change the TppField object to 'Date', it reverts back to 'Integer' when I reconnect the Session and Database.
If there's not an easy way round this, perhaps I could use a Calculated field, and somehow convert the Integer to a Date format?
-- Regards, John jkane@camozzi.co.uk
In article <3e6394f8$1@dm500.>, "Jim Bennett \(Digital Metaphors\)" says...
One way to work around it other than creating a special calculated field in the dataset, is to create a JITPipeline to return the fields from the dataset. You can use the JITPipeline events to surface data from a dataset. This way you can define the date field type on the TppField and always return the integer from the query as a date field to RB. Here is an example of using a JIT over a query: http://www.digital-metaphors.com/tips/JITFromDB.zip
Thank you for pointing me to the JITPipeline example. Before getting too deeply into this, I tried using a 'Variable' of type dtDate. In its OnCalc event I assigned it the value of my Long Integer. This appears to work fine and dates are displayed correctly. Am I missing something, or is this a reasonable work around?
-- Regards, John jkane@camozzi.co.uk
In article <3e64dc94$1@dm500.>, "Jim Bennett \(Digital Metaphors\)" says...
Comments
pipeline at design time to see a list of our field objects) defined for this
datafield from your dataset has a field type set to Date. Then you can
select the proper date format from our list of display formats in the report
designer by right clicking over the dbText. Then the proper day should
appear in the report for the dbText when you print the integer field as a
date field value.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Thank you for your reply. I'm afraid this doesn't seem to work. The database is Pervasive SQL
2000i [Btrieve] and I have to define this field as 'Integer' in the DDFs. Some users use MS
Access with Pass-Through Queries to access the data, and if I define the field as 'Date' an
ODBC call fails - Invalid Date. We have to use the CDate() function in an ordinary query to
get the correct date to display. Probably because it uses VB, which understands this date
format.
Back to Delphi and RB - if I change the TppField object to 'Date', it reverts back to
'Integer' when I reconnect the Session and Database.
If there's not an easy way round this, perhaps I could use a Calculated field, and somehow
convert the Integer to a Date format?
--
Regards, John
jkane@camozzi.co.uk
In article <3e6394f8$1@dm500.>, "Jim Bennett \(Digital Metaphors\)" says...
the dataset, is to create a JITPipeline to return the fields from the
dataset. You can use the JITPipeline events to surface data from a dataset.
This way you can define the date field type on the TppField and always
return the integer from the query as a date field to RB. Here is an example
of using a JIT over a query:
http://www.digital-metaphors.com/tips/JITFromDB.zip
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
tried using a 'Variable' of type dtDate. In its OnCalc event I assigned it the value of my
Long Integer. This appears to work fine and dates are displayed correctly. Am I missing
something, or is this a reasonable work around?
--
Regards, John
jkane@camozzi.co.uk
In article <3e64dc94$1@dm500.>, "Jim Bennett \(Digital Metaphors\)" says...
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com