Date and time in one

RRiverRRiver Member Posts: 4
edited 2003-10-31 in Navision Attain
Hello,
Has anyone been able to put a date into MS Outlook without using an OCX?

The problem is as following:

MS Outlook needs a date and time in one. Navision has seperated date and time types.

Anyone? :?

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Starting from MBS-Navision 3.60, there is a datatype called DATETIME:
    Use this data type to denote the date and time of day.

    The datetime is stored in the database as Coordinated Universal Time (UTC).

    UTC is the international time standard (formerly Greenwich Mean Time, or GMT). Zero hours UTC is midnight at 0 degrees longitude.

    The datetime is always displayed as local time in Navision Attain.

    Local time is determined by the time zone regional settings used by your computer.

    You must always enter datetimes as local time. When you enter a datetime as local time, it is converted to UTC using the current settings for the time zone and daylight saving time.
    But I doubt this can be used to fill in the date/time in Outlook. Never tried it.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • RRiverRRiver Member Posts: 4
    Navision has own date and time types: type DATE and type TIME. Outlook and MS SQL Server have common DATETIME type called DATE which consist of DATE and TYPE.
    Question: How I can extract 'time' from DATE type in Outlook or SQL Server and use it in Navision? :?:
  • DoomhammerDoomhammer Member Posts: 211
    Navision version 3.60 and later has new data type - DateTime. This data type was created to cooperate with Automation and OCX.

    When you wish to work with Outlook automation or OCX, simply create variable type DateTime and use it to acquire value from automation to Navision. When you have DateTime filled with value from Outlook, you can use functions DT2DATE to extract date from datetime and DT2TIME to extract time from datetime

    example:
    dtDatetime = datetime variable
    autAutomation = automation variable
    datDate = date variable
    timTime = time variable
    
    /// get datetime from automation
    dtDateTime := autAutomation.function
    
    /// converting to date and time variables
    datDate := DT2DATE(dtDatetime);
    timTime := DT2TIME(dtDateTime);
    
    /// that is all
    

    When using SQL date type, I think, that date part of datetime is filled and time part is blank.

    I hope this helps you :-)

    Keep smiling :P
    Martin Bokůvka, AxiomProvis
  • RRiverRRiver Member Posts: 4
    Big thanx for all!
    But this solution is ideal for Navision 3.60, but I need solution for Attain 3.10?
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Then use the Navision 3.60 (or later) client with the Navision 3.10 database. Don't forget to update the server as well.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • LG_HellströmLG_Hellström Member Posts: 13
    VARIANT2TIME() ?

    As I said at NOLUG :)
    Did I commit today?
  • astarothastaroth Member Posts: 7
    RRiver wrote:
    Big thanx for all!
    But this solution is ideal for Navision 3.60, but I need solution for Attain 3.10?

    I faced the same problem in 3.10, so I created a DLL in VB which I called with the parameters Outlook object and a Date and Time, which updated the object in Outlook.

    The same DLL I used the other way to get Date and Time from Outlook into Navision.
  • sitrasitra Member Posts: 8
    To convert date and time to DateTime
    I use the following instruction in SQL

    Date+ CONVERT(CHAR, Time, 8) AS DateTime

    where CONVERT(CHAR,Time,8) extracts the time from a DateTime field
Sign In or Register to comment.