SQL getdate -> Navision date/time

Jan79
Member Posts: 7
Hello,
i need to fill a Navision Date- and Time-Field via SQL. (No, i don't need a datetime-field in Navision) I use "getdate()" to retrieve the datetime of the SQL server, but i don't know how to convert it to a navision Date- or Time-Field.
Looks for me like a common problem, if you want to insert Data via SQL in Navision, but unfortunatly i haven't found a solution for that problem.
Anyone there who could help me out?
Thanks in advance!
Cheers,
Jan
i need to fill a Navision Date- and Time-Field via SQL. (No, i don't need a datetime-field in Navision) I use "getdate()" to retrieve the datetime of the SQL server, but i don't know how to convert it to a navision Date- or Time-Field.
Looks for me like a common problem, if you want to insert Data via SQL in Navision, but unfortunatly i haven't found a solution for that problem.
Anyone there who could help me out?
Thanks in advance!
Cheers,
Jan
0
Comments
-
If you see your SQL database you'll see that date and time fields are DATETIME fields in SQL.
So a date field is just the SQL DateTime field with time 0:00:0 and the exception that 0D is 1/1/1753 0:00:00 (example: Posting Date: 18/4/2006 0:00:00 )
A time field is again a datetime field with the date part set to 1/1/1754 (Example: 1/1/1754 8:00:00 ) with the exception of the blank time which is
1/1/1753 0:00:00
So
'1753-01-01 00:00:00:000' will give you a blank time field.
'1754-01-01 12:34:13:000' will give you a 12:43:13 time field
'2009-01-28 00:00:00:000' will give you a 28/01/2009 date field and
'1753-01-01 00:00:00:000' will give you a 0D date field.
Anyway, this is what I see in my SQL server.
Hope this helps...0 -
Thanks for your info.
But i'm not sure how to generate those field-values. I mean like setting the time to 0:0:0 so it becomes a valid Navision- Datefield.
Cheers,
Jan0 -
Are you asking for specific SQL commands for formatting / converting values and types?0
-
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions