Want to remove Char from the DATE

JAYESH
Member Posts: 290
HI to all...
I have posting date like - c05/06/07.
I am trying to export the date from the dataport.
I want to remove C while they export data.
The posting date must look like 05/06/07.
I request you to please share ur ideas..
Thank you..
I have posting date like - c05/06/07.
I am trying to export the date from the dataport.
I want to remove C while they export data.
The posting date must look like 05/06/07.
I request you to please share ur ideas..
Thank you..
JAYESH PATEL
0
Answers
-
did you try using FORMAT & DELCHR?
Format the date field & delchr the result
PS When you export theis closed date the "c" actually appears?0 -
i format date in to string.
And i used DELCHAR to remove C from the date.
But I want to store value what i got in to DATE field again to export.
LIKE
DT - Text
DT := FORMAT(DATE);
DT := DELCHAR(DT,'=',C);
How i store STRING value in to DATE it's not possible
DATE := DT ---- NOt possible..
be'z the DATE is DATAPORT filed which is exported from the dataport.
Thank you...JAYESH PATEL0 -
aren't you exporting it to a text file anyway? why do you need it to be put back into a date type variable?
http://www.mibuso.com/forum/viewtopic.p ... nvert+date
I'm not a codemaster but I think you could combine (not tested)
EVALUATE(DELCHAR(FORMAT(DATE),'=',C),varDate);0 -
The date is field of Table
I used that table and mention date fileds as DATAPORT filed.
So i must have to store the value which i got at end to store in to date filed.
I think then only they gonna export date in the format which i got...
Thank youJAYESH PATEL0 -
JAYESH wrote:The date is field of Table
I used that table and mention date fileds as DATAPORT filed.
So i must have to store the value which i got at end to store in to date filed.
I think then only they gonna export date in the format which i got...
Thank you
Not sure if that makes any sence but I hoped I helped a little 8)0 -
By using this its done..i remove the C from the Date and the data is now exported with out include C in to the Date field.
Boo - is boolean
Dt - Text
DAT - Date
DT := FORMAT("G/L Entry"."Posting Date");
DT := DELCHR(DT,'=','C');
Boo := EVALUATE(DAT,DT);
IF Boo = TRUE THEN
"G/L Entry"."Posting Date" := DAT;
Thank you for your support...JAYESH PATEL0 -
JAYESH wrote:Boo - is boolean
Dt - Text
DAT - Date
feel free to be descriptive with your Variables - it will help one day down the road when you review the dataport and go "what was I thinking"?
I'm pretty sure you can eliminate the boo
Boo - is boolean
Dt - Text
DAT - DateDT := FORMAT("G/L Entry"."Posting Date"); DT := DELCHR(DT,'=','C'); EVALUATE(DAT,DT); "G/L Entry"."Posting Date" := DAT;
0 -
Savatage wrote:...I'm not a codemaster but I think you could combine (not tested)...
Not sure about that,from some of your posts lately, looks like you are becoming a developer. I always say that the best Navision programmers are always those that started out on the End User side having had to struggle with problematic code.
=D>David Singleton0 -
cleanDATE:=(DELCHAR(FORMAT(DATE),'=',C));
EVALUATE(cleanDATE,varDATE);
does that look better (still not tested) I'm sure on the first error message I'd figure it out [-o<0 -
Savatage wrote:cleanDATE:=(DELCHAR(FORMAT(DATE),'=',C));
EVALUATE(cleanDATE,varDATE);
does that look better (still not tested) I'm sure on the first error message I'd figure it out [-o<
Actually there are lots of ways to do this. I would want to address the issue that the user enters bad text, so would change it to:cleanDATE:=(DELCHAR(FORMAT(DATE),'=',C)); IF NOT EVALUATE(cleanDATE,varDATE) THEN varDATE := 010101D; // <- or workdate or what ever.
David Singleton0 -
Look at the FieldNames that are possible when formating a date. You will find that the standard formats generally include the 'Closing' field (which is where the 'C' comes from) but you can build a custom format that does not include this.
I'm not really sure what you are trying to do but you should also check out the NORMALDATE and CLOSINGDATE functions.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