×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Un concatenate? Extrapolate data from description field

Un concatenate? Extrapolate data from description field

Un concatenate? Extrapolate data from description field

(OP)
I got great help to do this in SQL, unfortunately I can't save it as a View to link to and was hoping someone knows how to modify this to work in Access query?

CODE

select LogDate, LogTime, CompanyCode, UserLogon, ModuleCode, logdescription
from SY_ActivityLog
Where LogDate >= '4/18/2018' and ModuleCode = 'S/O' and LogDescription like 'Unable to reset Qty to Ship%'
select LogDate, LogTime, CompanyCode, ModuleCode, logdescription
      ,replace(substring(logdescription
                        ,charindex('Item ',logdescription)+5
                        ,charindex(' '
                                  ,logdescription+' '
                                  ,charindex('Item ',logdescription)+5
                                  )
                        -charindex('Item ',logdescription)-5
                        )
              ,','
              ,''
              )
       as item
      ,replace(substring(logdescription
                        ,charindex('Invoice ',logdescription)+8
                        ,charindex(' '
                                  ,logdescription+' '
                                  ,charindex('Invoice ',logdescription)+8
                                  )
                        -charindex('Invoice ',logdescription)-8
                        )
              ,','
              ,''
              )
       as invoice
      ,replace(substring(logdescription
                        ,charindex('Sales Order ',logdescription)+12
                        ,charindex(' '
                                  ,logdescription+' '
                                  ,charindex('Sales Order ',logdescription)+12
                                  )
                        -charindex('Sales Order ',logdescription)-12
                        )
              ,','
              ,''
              )
       as salesorder
  from sy_activitylog
  Where LogDate >= '5/8/2018' and ModuleCode = 'S/O' and LogDescription like 'Unable to reset Qty to Ship%'
; 

RE: Un concatenate? Extrapolate data from description field

If the data is on a server, you can use a pass-through query which is more efficient and uses the same syntax as the server.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Un concatenate? Extrapolate data from description field

(OP)
Oh WOW! Thank you!
That worked after removing the 1st section of the SELECT

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close