how to get Server date?

yanfeng
Member Posts: 2
Navison Install use Client\server, DB is Microsoft SQL, in client , how do i can get Server date?
0
Comments
-
Hi,
what do you need it for? I do not know any way to get the server date at the client in Navision.
There might be some workarounds.0 -
creat this view on the ms sql in your Navision Database:
CREATE VIEW dbo.ServerDateTime_View
AS
SELECT '' AS PK, GETUTCDATE() AS ServerDateTime
ORDER BY ''
Create new table in Navision with same name as the view (you can use another
name in the view),
create two fields:
1 PK Code 20
2 ServerDateTime DateTime
Set properties:
DataPerCompany = No
LinkedObject = Yes
Save the table. If you make SDT.GET; (SDT is variable of type Record for
your new table) you have in field SDT.ServerDateTime the server date and
time...
The field PK is there only as simulation of Primary key to be able to make
GET for this table...0 -
hi kine, how the navision table trigger or link together with the SQL Server view dbo.ServerDateTime_View? May u explain the concept?
Thank you very much =D>
Kok Keong0 -
It's explained in this thread: http://www.mibuso.com/forum/viewtopic.php?t=5906 (read answers from Waldo and fb).No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
thanks Luc Van Dyck and kine.0
-
Or, if tables are hard to find, you could try a little Automation code... (adoRecSet is 'Microsoft ActiveX Data Objects 2.8 Library'.Recordset)
CREATE(adoRecSet); adoRecSet.open( 'SELECT CONVERT(char(25), GETDATE(), 126) AS ServerDateTime', 'Provider=SQLOLEDB;Server=(local);Trusted_Connection=Yes'); theDateTimeString := FORMAT(adoRecSet.Fields.Item(0).Value); CLEAR(adoRecSet); MESSAGE(theDateTimeString);
Of course, you must change 'Server=...' to the name of your SQL server...0 -
[Topic moved from Navision forum to Navision Tips & Tricks forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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