Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula using Startswith and adding Date to end

Status
Not open for further replies.
Jun 17, 2010
58
US
I am trying to figure out how to create a formula selection that would look for "BRIAN" and then the date as noted in the example would be the next operation. So basically "BRIAN today" with the spaces in between are what I am looking for. Suggestions on the advanced formula for this concatenation.

{CONTSUPP.CITY} startswith "BRIAN 20100818 2:30pm
 
Are the number of spaces always the same.

you can use split({CONTSUPP.CITY}, " ")[2]

this will return datetime string, you can then convert that to a data and compare to currentdate.

Ian
 
Not all the fields are formatted the same way unfortunately. As such, I am getting an error with that particular code.

I've tried looking for alternatives to do this...

This was a thought but it doesn't work

if instr({CONTSUPP.CITY}, 'BRIAN') > 0 then
(split({CONTSUPP.CITY}, " ")[2] = totext(currentdate))

Any particular employee name can be the first part of the string. This is another example

REPORTS 20100813 5:00pm

 
Also have considered using the trim feature..but unsure how to use it in this manner
 
What are you trying to accomplish? Are you really just trying to pick out strings that contain today's datetime? Then just use:

{table.string} like "*"+totext(currentdatetime,"yyyyMMdd h:mmtt")+"*"

-LB
 
Yes, I'm trying to find

"BRIAN todaysdate" and have it be dynamic as you've written to show these values every day the report is run. I've actually thought about making it dynamic for the name of the user too to expand the report. Unsure how to put the beginning part with the name and space and then now the trouble of getting todays' date in the search string is resolved thanks to LB.

 
If you used my formula it would have picked up the name because of the wildcard (*).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top