Tony Olivas Posted November 3, 2010 Share Posted November 3, 2010 Hello all, I'm looking for a rule that would drop the last five digits in provided data. For example the data field provided is 10/21/2010. I want to output 10/21. Thanks in advance. Link to comment Share on other sites More sharing options...
esmith Posted November 3, 2010 Share Posted November 3, 2010 To do literally what you are asking, you just need the following: var result = Left(Field("YOUR FIELD"), Field("YOUR FIELD").length - 5); Link to comment Share on other sites More sharing options...
Tony Olivas Posted November 3, 2010 Author Share Posted November 3, 2010 Eric, Thanks for replying. I applied your code but I get an Error: Function doese not return a value. Am I missing something? Link to comment Share on other sites More sharing options...
esmith Posted November 3, 2010 Share Posted November 3, 2010 Are you replacing "YOUR FIELD" with your field? What is the value of the field being used? Are you adding a return line to actually return the result? Link to comment Share on other sites More sharing options...
Tony Olivas Posted November 3, 2010 Author Share Posted November 3, 2010 No, I'm not return a return line. I tried it but did get anything. This is what I plugged in using your code. Link to comment Share on other sites More sharing options...
esmith Posted November 3, 2010 Share Posted November 3, 2010 Let's see if I can simplify: var result = Field("YourField"); // replace with field name from your data containing date return Left(result, result.length - 5); Link to comment Share on other sites More sharing options...
Tony Olivas Posted November 3, 2010 Author Share Posted November 3, 2010 Awesome! That's it. Thanks, Eric:D Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.