Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6798271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:42:36+00:00 2026-05-26T18:42:36+00:00

I have this sp. I just found out that M.MDS_FILE column, contains a file

  • 0

I have this sp. I just found out that M.MDS_FILE column, contains a file name as this:
adlu201008261156_3.zip. The submission date is embedded in the file name.

How can I pick out this date? 20100826 this portion and use in the sp? that is the date needed to use here:
instead of GETDATE.

  SET ANSI_NULLS ON
            GO
            SET QUOTED_IDENTIFIER ON
            GO

            ALTER PROC [dbo].[GET_SCHEDULE_SUBMITTED_DETAIL]
            @FACILITYKEY varchar(1000),
            @UNITSTR VARCHAR(100),
            @FromDate datetime,
            @ToDate datetime
            AS
            BEGIN

            SELECT S.FACILITY_KEY, S.PAT_NUMBER, S.A3A_DATE_USER, M.REFERENCE_DATE ,
            RTRIM(P.LAST_NAME) + CASE WHEN RTRIM(P.FIRST_NAME) <> '' THEN ', '
            ELSE ''
            END + RTRIM(P.FIRST_NAME) PATIENT_NAME
            ,CASE WHEN P.NURSING_UNIT is not null THEN P.NURSING_UNIT ELSE '' END NURSING_UNIT
            ,CASE WHEN P.UNIT_CODE is not null THEN P.UNIT_CODE ELSE '' END UNIT_CODE, 'SUBMITTED'  AS ASSESSMENTS
            FROM [OPTC].MDS_M_SCHEDULE S INNER JOIN OPTC.MD3_M_MAST M
            ON S.PAT_NUMBER=M.PAT_NUMBER
            LEFT JOIN OGEN.GEN_M_PATIENT_MAST P ON S.PAT_NUMBER = P.PAT_NUMBER
            WHERE S.PAT_NUMBER=M.PAT_NUMBER AND M.REFERENCE_DATE < GETDATE()
            AND S.A3A_DATE_USER BETWEEN @FromDate AND @ToDate
            AND M.SIGN_DATE IS NOT NULL AND M.MDS_FILE IS NOT NULL AND S.FACILITY_KEY IN (SELECT Value FROM dbo.ListToTable(@FACILITYKEY,','))
            AND ( @UNITSTR IS NULL
            OR @UNITSTR = ''
            OR CHARINDEX(P.UNIT_CODE, @UNITSTR)% 2 = 1 )

            END
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:42:37+00:00Added an answer on May 26, 2026 at 6:42 pm

    You didn’t mention which database this is, but most have a function for performing a regex match on a string. For instance, Oracle has REGEXP_SUBSTR. Run that on the column, with the proper regex (something like \d{12}) and then parse the result as a date.

    Edit: And consider changing your schema as posted in the earlier answer – if possible because this won’t be super efficient.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just found this great tutorial as it is something that I need.
I have this test code that just saves an XML file to a folder.
Being new to programming I have only just found out that you can specifically
I've just found out that a spammer is sending email from our domain name,
So, we just found out that 254 tables in our Oracle DBMS have one
I have this command to check for valid email address. I just found out
I have just found out that my script gives me a fatal error: Fatal
I just found out that Firefox is natively supporting mouseenter and mouseleave events. This
I have this class file call SMSHelper.cs First I just wanted to know is
I have this code in PHP writing views to a text-file and just increasing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.