locked
I need a field containing 00:00:00 as numeric (not text) in VFP to export dbf files to Sage 300 2020 RRS feed

  • Question

  • I am creating a series of .csv files to import records in Sage 300 Payroll using low level file functions. There is one field called Valtime that requires 00:00:00 as a "number" not  text with Quotes on each side. I either need to find out how to create a time field with the date portion or a low level function to strip the Quotes from around each of the records. If I create a field called Valtime T(8) the format is   /  /    :  :  AM. 
    Wednesday, August 12, 2020 7:31 PM

All replies

  • You mentioned VFP in the title, do you want to do this in Visual FoxPro? The MSDN forums for VFP have been archived (and not sure, most likely not, they were brought to Q&A).

    Anyway, I did a quick search and found https://social.msdn.microsoft.com/Forums/en-US/9e7d5e2a-7bbb-436f-96d8-0947df7df6c6/converting-date-field-amp-character-time-field-to-a-datetime-field?forum=visualfoxprogeneral 

    although I don't like the very first solution (and the rest of the solutions I would not even consider). 

    If you still want to get support for VFP, then I personally use levelextreme.com forum (this is the place where VFP developers hang out), you can also get support in tek-tips forum (haven't looked at that in years). 

    BTW, did you simply try

    CAST(timeColumn as DateTime) ? This may work, although I don't want to fire VFP to try it out myself.

    Also, VFP has a concept of empty date and time while other database engines use NULL for the 'empty' date/time.


    Looking for new opportunities

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog


    My TechNet articles



    • Edited by Naomi N Wednesday, August 12, 2020 7:44 PM
    Wednesday, August 12, 2020 7:40 PM
  • Hi Steven Starace,

    Your issue is related to VFP. I suggest you open a thread in VFP forums, People there will help you more effectively.

    Besides,CAST and CONVERT (Transact-SQL) can convert an expression of one data type to another.
    Hope this could help you.

    Best Regards 
    Echo 



    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    Thursday, August 13, 2020 8:54 AM
  • Echo,

    The VFP forum in MSDN has been archived (no announcement was done prior to that). Can you please find out if it was brought to Q&A or just shut down completely?


    Looking for new opportunities

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog


    My TechNet articles

    Thursday, August 13, 2020 1:17 PM
  • Hi Naomi,

    Sorry, I did not see that the VFP forum has not been updated recently. I spent some time looking for a new VFP forum, but I didn’t find it. I also asked my colleagues for help. Unfortunately, I still couldn’t find it.

    And I found that the VFP forum does not seem to have a Microsoft engineer to solve the problem, and I did not find the VFP forum in the Microsoft QA forum.

    Best Regards 
    Echo


    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.


    • Edited by Echo Liuz Friday, August 14, 2020 8:50 AM
    Friday, August 14, 2020 8:45 AM
  • Hi Steven Starace,

    Has your problem been solved? If it is solved, please mark the point that you 
    think is helpful as an answer. This can help others who encounter similar problems.

    Best Regards 
    Echo   


    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.


    • Edited by Echo Liuz Monday, August 17, 2020 6:01 AM
    • Proposed as answer by Echo Liuz Thursday, August 20, 2020 5:26 AM
    Monday, August 17, 2020 5:59 AM
  • SQL Server has TIME, DATE and DATETIME2(n) datatypes; would this help? 

    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking in Sets / Trees and Hierarchies in SQL

    Monday, August 17, 2020 6:20 PM