mibuso.com

Microsoft Business Solutions online community
It is currently Wed Jun 19, 2013 11:19 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Input Date fields on NAV based on MSSQL transactions
PostPosted: Wed Apr 11, 2012 12:14 pm 
Offline

Joined: Thu Dec 16, 2010 8:11 am
Posts: 97
Country: Bangladesh (bd)
Hi all,

I have an issue when importing records from the MSSQL database to NAV.

I have 2 fields namely Start Date and End Date in my sql table.

On NAV, i want to input the Start Date and End Date on my card form which will display transactions made within that date range on the push action of command button('Import').

Please help

Thanks
Liizz


Top
 Profile E-mail  
 
 Post subject: Re: Input Date fields on NAV based on MSSQL transactions
PostPosted: Wed Apr 11, 2012 12:46 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4254
Location: New Delhi
Country: India (in)
what problem are ypu facing here?

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: Input Date fields on NAV based on MSSQL transactions
PostPosted: Wed Apr 11, 2012 1:09 pm 
Offline

Joined: Thu Dec 16, 2010 8:11 am
Posts: 97
Country: Bangladesh (bd)
The filtering is not being done based on the Start Date and End Date on NAV, its importing the whole list of transactions.

Let's say:
Start Date:02/04/2012 ; End Date:06/04/2012.
I should have obtained data within this particular date range.

Thanks
Liizz


Top
 Profile E-mail  
 
 Post subject: Re: Input Date fields on NAV based on MSSQL transactions
PostPosted: Wed Apr 11, 2012 1:13 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4254
Location: New Delhi
Country: India (in)
What did you write in Import button?

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: Input Date fields on NAV based on MSSQL transactions
PostPosted: Wed Apr 11, 2012 1:58 pm 
Offline

Joined: Mon Jul 28, 2008 2:37 pm
Posts: 674
Location: AT
Country: Austria (at)
liizz wrote:
I have an issue when importing records from the MSSQL database to NAV.
If I understand this correctly you are importing some transactional data from the SQL system tables into a NAV database!? :shock:


Top
 Profile  
 
 Post subject: Re: Input Date fields on NAV based on MSSQL transactions
PostPosted: Wed Apr 11, 2012 2:40 pm 
Offline

Joined: Thu Dec 16, 2010 8:11 am
Posts: 97
Country: Bangladesh (bd)
Yes exactly..

But the BStartDate and BEndDate in sql is of datatype datetime.

On NAV, I want to input the date in the following format dd/mm/yy.

This is why I am having this issue about incorrect syntax near the year.

Please advise how to solve it out.

Thanks
Liizz


Top
 Profile E-mail  
 
 Post subject: Re: Input Date fields on NAV based on MSSQL transactions
PostPosted: Wed Apr 11, 2012 2:53 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4254
Location: New Delhi
Country: India (in)
Check whether CONVERT Function helps you or not
http://www.w3schools.com/sql/func_convert.asp

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: Input Date fields on NAV based on MSSQL transactions
PostPosted: Wed Apr 11, 2012 3:16 pm 
Offline

Joined: Thu Dec 16, 2010 8:11 am
Posts: 97
Country: Bangladesh (bd)
Is there in NAV codes I can adjust the date format using EVALUATE.


Thanks
Liizz


Top
 Profile E-mail  
 
 Post subject: Re: Input Date fields on NAV based on MSSQL transactions
PostPosted: Wed Apr 11, 2012 4:13 pm 
Offline

Joined: Tue Jun 07, 2005 5:24 pm
Posts: 2591
Location: MA
Country: United States (us)
How is NAV "seeing" the data in the other database? Is this via a "linked table" or other method. This is where you want to handle any data format issues.

_________________
There are no bugs - only undocumented features.


Top
 Profile E-mail  
 
 Post subject: Re: Input Date fields on NAV based on MSSQL transactions
PostPosted: Thu Apr 12, 2012 6:58 am 
Offline

Joined: Thu Dec 16, 2010 8:11 am
Posts: 97
Country: Bangladesh (bd)
There is an application which is saving these transactional data in the SQL table and then an ADODB connection has been created to import these data into a temp table on NAV.

I do not want to change the datatype of the EndDate in SQL table.

It would been more appropriate to handle this change to dd/mm/yy in NAV itself.


Top
 Profile E-mail  
 
 Post subject: Re: Input Date fields on NAV based on MSSQL transactions
PostPosted: Thu Apr 12, 2012 12:11 pm 
Offline

Joined: Tue Jun 07, 2005 5:24 pm
Posts: 2591
Location: MA
Country: United States (us)
You don't need to change the datatype in the SQL table. It's already datetime. The same SQL datatype as the NAV database. What you need to do is format it in your SELECT statement using CAST/CONVERT.

_________________
There are no bugs - only undocumented features.


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: