Converting a interger to a string and then using as a join in a sp.

I have a stored procedure where i am trying to join an order table to a customer table by cust #
in the order table the customer is an interger
in the customer table the customer is a string
i am using the following stored proc.
when i run the report it get a CONVERSION FAILED WHEN CONVERTING A VARCHAR TO INT.
how can i convert it then use it to join to?  do i have to declare it first?
alter PROCEDURE [dbo].[CR_CREDIT_LIMIT_REVIEW]
AS
SELECT    
BPW5_2_Staging.dbo.OORDHDRA.DIVNA          AS COMPANY,
BPW5_2_Staging.dbo.OORDHDRA.ORODAT          AS ORDER_DATE,
BPW5_2_Staging.dbo.OORDHDRA.ORRTYP          AS ORDER_TYPE,
BPW5_2_Staging.dbo.OORDHDRA.ORNUMA          AS ORDER_NUMB,
BPW5_2_Staging.dbo.OORDDETL.ORSEQD          AS LINE_#,
(BPW5_2_Staging.dbo.OORDDETL.ORSIZ1     +BPW5_2_Staging.dbo.OORDDETL.ORSIZ2     BPW5_2_Staging.dbo.OORDDETL.ORSIZ3BPW5_2_Staging.dbo.OORDDETL.ORSIZ4
BPW5_2_Staging.dbo.OORDDETL.ORSIZ5BPW5_2_Staging.dbo.OORDDETL.ORSIZ6BPW5_2_Staging.dbo.OORDDETL.ORSIZ7BPW5_2_Staging.dbo.OORDDETL.ORSIZ8
+BPW5_2_Staging.dbo.OORDDETL.ORSIZ9)     AS UNITS,
BPW5_2_Staging.dbo.OORDDETL.orprce          AS COST,
BPW5_2_Staging.dbo.OORDDETL.ORACTD          AS ORACT,
BPW5_2_Staging.dbo.OORDDETL.ORSHPD          AS START_DATE,
dbo.OCUSMA.OKCUNO,
dbo.OCUSMA.OKCUNM,
dbo.OCUSMA.OKCRLM,
dbo.OCUSMA.OKTDIN
FROM        
dbo.OORDHDRA INNER JOIN
dbo.OORDDETL ON dbo.OORDHDRA.ORNUMA = dbo.OORDDETL.ORNUMD
AND dbo.OORDHDRA.CONOA = dbo.OORDDETL.CONOD AND
dbo.OORDHDRA.DIVNA = dbo.OORDDETL.DIVND
INNER JOIN
dbo.OCUSMA ON dbo.OORDDETL.ORACTD = dbo.OCUSMA.OKCUNO
WHERE     BPW5_2_Staging.dbo.OORDDETL.ORSTAT not in('S','C','R')
ORDER BY BPW5_2_Staging.dbo.OORDDETL.ORACTD

figured it out
in the join statement i used this cast statement
CAST(dbo.OORDDETL.ORACTD As VARCHAR(12))  = dbo.OCUSMA.OKCUNO

Similar Messages

  • How could I choose some bytes from HEX string and then convert it to a decimal value?

    Hi I am working with an OMRON E5EN temperature controller using VISA serial to get data, I send the Read from Variable Area command and get this string  in hexa 0230 3130 3030 3030 3130 3130 3030 3030 3030 3030 3041 3203 71 or .01000001010000000000A2.q in ASCII this string means:
    02 STX
    3031 3030 Node and subadress
    3030 End Code Normal Completion
    3031 3031 Command Read from Variable Area
    3030 3030 respt code Normal completion
    3030 3030 3030 4132 Hexadecimal A2 = 162  (this is the temperature data that I want to show in decimal)
    03 ETX
    71 Block Check Character
    I want to choose the eight bytes for the temperature data and convert it to a decimal number. I have seen the examples to convert a Hexa string to decimal but I do not know how to choose the specifics bytes that I need.
    I have look for a driver but i didn´t find any. I am a beginner so please include especific topics for me to study in your answer.
    Thanks
    Carlos Fuentes Silva Queretaro Mexico 

    If the response always has the temperature starting with byte 15 and is always 8 bytes in length, you can use the String Subset function to get those bytes out of the string.  Then use Hex String to Number to convert to a decimal number.
    Well someone already beat me to the solution:
    Message Edited by tbob on 01-04-2008 04:42 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    HexStr2Decimal.png ‏7 KB

  • Convert string to datetime and then use in a where clause

    I am trying to pull in warranty expiry dates that have been entered as strings and then perform a calculation as to which ones are expired, about to expire within
    90 days or will expire in more than 90 days. I have got the query to a point where I have converted it to a datetime field (though I'm sure I used the right value to just give me the date, its giving me date and time) and have it printing out the machine name
    and the warranty for that machine.
    SELECT
      machNameTab.machName
      ,convert(date,auditRsltManualFieldValues.fieldValue,103) AS warranty
    FROM
      machNameTab
      INNER JOIN auditRsltManualFieldValues
        ON machNameTab.agentGuid = auditRsltManualFieldValues.agentGuid
    WHERE
      machNameTab.groupName = N'root.company'
      AND auditRsltManualFieldValues.fieldNameFK = 958472722796011
    What I need to do next is change this so instead of just spitting out all the dates as 'Warranty', I want it to give me the fields 'Expired', 'Expiring' (expiry date is within 90 days of the current date) and 90Days (expiry date is over 90 days from the current
    date)

    SELECT
    machNameTab.machName
    ,convert(date,auditRsltManualFieldValues.fieldValue,103) AS warranty,
    select
    case
    when datediff(day,getdate(),convert(date,auditRsltManualFieldValues.fieldValue,103) )<90 then 'Expiring'
    when datediff(day,getdate(),convert(date,auditRsltManualFieldValues.fieldValue,103) )<0 then 'Expired'
    when datediff(day,getdate(),convert(date,auditRsltManualFieldValues.fieldValue,103) )>=90 then '90Days'
    end as status
    FROM
    machNameTab
    INNER JOIN auditRsltManualFieldValues
    ON machNameTab.agentGuid = auditRsltManualFieldValues.agentGuid
    WHERE
    machNameTab.groupName = N'root.company'
    AND auditRsltManualFieldValues.fieldNameFK = 958472722796011
    I added a case to your select. The case will output the strings you wanted based on the date.

  • Is there a way to create an object using Trapcode Form and then use that object as a particle in Trapcode Particular?

    I made some objects in Cinema 4D and I tried to import them into After Effects CC 2014.  I get an error saying 'Cannot find Adobe Premiere Pro Dynamic Link'.  So I tried it in AE CC and that worked.  However, I want to create a form object and then use that as a particle for Trapcode Particular.  Is this even possible?
    Thank you for any help!

    There are also size limitations or rather suggestions for particle size. If I were creating an animated 3D shape using Form or C4D and wanted to use it as a particle I would keep the size of the particle about 1/6 to 1/8 of the comp size. You would create a new comp for your particle, animate it, then nest the particle comp in your main comp, turn off visibility, and then use it as a particle in Particular.

  • I want to be able to use airplay to stream audio to another iOS device, and then use that audio stream to be used when recording video instead of the built in microphone / microphone input. Is this possible?

    I want to be able to use airplay to stream audio to another iOS device, and then use that audio stream to be used when recording video instead of the built in microphone / microphone input. Is this possible?

    A third-party app probably cannot obtain a stream from another app. To the best of my knowledge, such a capability is not provided in the software development kit, apps being "sandboxed" from each other and so allowed to communicate only in very specific and limited ways.
    I'm not completely sure what you mean by "limitations on video capture". An iPhone, to the best of my knowledge, can natively record video only through it's built-in camera, and audio while doing video recording only through the built-in microphone or mic/headphone jack. There might be a video recording app that would allow audio input from an external device connected to the dock connector, but I'm not sure.
    Regards.

  • Can I put a SQL query into a bind variable and then use it to output report

    Hi,
    Can I put a SQL query into a bind variable and then use it to output report?
    I want to create a report and an item "text area" (say P1_TEXT) which can let user to input a SQL query(they are all technical users and knows SQL very well). Then, I use a bind variable (that text area) to store the SQL statement. Then, I add a submit button and I want to use the following to output the report:
    select * from (:P1_TEXT);
    Do you think it is possible to do that? Any known limitations for APEX in this area?
    Thanks a lot,
    Angela

    You can, but make sure it's what you really want to do. Make sure you are VERY familiar with SQL Injection. Most people who know what it is, go out of their way to prevent SQL Injection. You're going out of your way to allow it.
    You can try using &P1_TEXT. instead of bind variable syntax. Bind variables are one of the best ways to prevent SQL Injection, which is why it's not working for you.
    Once again, I strongly urge you to consider the implications of your app, but this suggestion should get it working.
    Tyler

  • How can I import a non-BC site into BC, using Dreamweaver CC, and then use it as one of my free sites?

    I am trying to import one of my non-BC sites into BC, using Dreamweaver CC, and then use it as one of my free WebBasics sites.
    When I try to create a new BC site in Dreamweaver CC, it creates a BC template site, and I have unsuccessfully tried to update the files on BC - it won't let me connect.
    If I import the site from my portal, I don't get the option of a free site - when I try to upgrade, I get the credit card form asking for payment.
    I feel like I'm running around in circles with one foot nailed to the floor.
    Any tips?

    Thank you for your quick reply and for clearing up my confusion.  I'm exporting the first section now.  I choose the smallest size, 3x4 but I'd prefer to go higher as this DVD was originally a VHS home movie.  I'm wondering if after three conversions (VHS,->DVD->MPEG) the resolution will be so poor as to not support a larger size frame?  If it can, what size should I select when I export? 

  • What are the steps to make it seamless for a customer to use the install program and then use the installed program?

    I wrote an install program (.exe) that is downloaded from a website.  When run, it 1) leads a customer to browse to a directory, and 2) copies files (.exe, .dll, etc.) from a website to that directory.  When I run, the installed program works.
    What are the steps to make it seamless for a customer to use the install program and then use the installed program? 
    bhs67

    This site https://msdn.microsoft.com/en-us/library/vstudio/2kt85ked%28v=vs.110%29.aspx provides a basic description of the Visual Studio Windows Installer. 
    Near the bottom of the page is "You can unlock all the features of InstallShield by paying to upgrade to the full version of InstallShield."  Where do I find info that describes the differences between the "free" and the "full"
    versions?
    bhs67
    Hello,
    The default feature does support the task for your requirement, so there is no need to pay for the other features unless you want to use some feature which is not free.
    In addition, as this thread
    InstallShield LE not available with VS 2012 RTM? shared, even through there is a link to InstallShield LE in the New Project dialog under Deployment solutions, but it belongs to third-party that I would recommend you consider posting this issue
    at the following forum to get supports about InstallShield.
    http://community.flexerasoftware.com/forumdisplay.php?133-InstallShield
    Regards.
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Is it possible to reinstall Mac OS X Lion on MacBook and then use Time Machine to restore to the previous backup I made before reinstalling Mac OS X Lion?

    Is it possible to reinstall Mac OS X Lion on MacBook and then use Time Machine to restore to the previous backup I made before reinstalling Mac OS X Lion?

    My MacBook was not normally booting up. It would turn on, make the Apple startup noise, and the bottom loading bar would progress just a little bit, then my MacBook would shut down. I tried rebooting it many times and the same thing would happen, it would just shut down. Then, I read that I can reset the PRAM (by holding Option+Command+P+R after the Apple startup noise comes). That worked, but now I get a screen that asks me to choose one of the 4 options (see:  http://images.macworld.com/images/article/2012/07/lionrecoveryutilities-289404.j pg). I choose Restore From Time Machine Backup, but it progresses to 17.6% and gets stuck there forever. I tried doing it again, and it got stuck at 17.6% again. That is why I am asking if I should just reinstall Lion, then restore a previous backup on the fresh new Lion?

  • Received adobe photoshop elements 12/adobe premiere elements 12 when I purchased a MacBook Pro.   The macBook Pro does not have a DVD player it is sold separately.     To install the program can I download a free trial version and then use the serial numb

    Received adobe photoshop elements 12/adobe premiere elements 12 when I purchased a MacBook Pro.   The macBook Pro does not have a DVD player it is sold separately.     To install the program can I download a free trial version and then use the serial numbers from the set I received?

    yes, that's exactly what you should do,
    Downloads available:
    Suites and Programs:  CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  12 | 11, 10 | 9,8,7
    Lightroom:  5 | 4 | 3
    Captivate:  7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • Can I attach a link to one image and then use that linked image multiple times in my site?

    Hi,
    Is it possible to attach a link to an image and then use that image (with link attached) multiple times in my site.
    Thanks,
    Ally

    Use 'Find and Replace'>under the 'Edit' menu.
    Select from 'Find in'- Folder and browse to the folder your website files are kept in to select it.
    Search: Source Code
    In the Find box (but obviously use YOUR image code):
    <img src="images/imageName.jpg" width="200" height="200" alt="" />
    In the Replace box: (use YOUR link and image code)
    <a href="yourLink.html"><img src="images/imageName.jpg" width="200" height="200" alt="" /></a>
    Then select 'Replace All'

  • I installed Firefox sync and then used iphone app called FireFox Home and I can syncronize history, tabs and bookmarks. But I am NOT able to syncronize passwords from Firefox in my Macbook to FireFox Home on iPhone !

    I installed Firefox sync and then used iphone app called FireFox Home and I can syncronize history, tabs and bookmarks. But I am NOT able to syncronize passwords from Firefox in my Macbook to FireFox Home on iPhone so I am very terrible to input my IDs and Passwords with my hands on FireFox Home when I log into Facebook, Twitter etc... Is it issue or something like that? If you have some solutions to make it clear, can you tell me how to syncronize memorized IDs and Passwords for the webs. Thank you.

    You can look in Tools > Options > Sync
    Menu differences: [http://kb.mozillazine.org/Menu_differences Windows: Tools > Options - Mac: Firefox > Preferences - Linux: Edit > Preferences]
    See also:
    * [[What is Firefox Sync]]
    * [[How to sync Firefox settings between computers]]
    * [[How to sync Firefox between my desktop and mobile]]

  • How can I apply a timestretch to different null objects and then use them to parent layers?

    I am using several hundred stills which are held on screen for different lengths of time. Is there a way to create null objects with various timestretch values and then use them to parent my stills?
    I'm trying to find an equivalent to the 'paste attributes' function in Final Cut Pro.
    Thanks in advance
    A

    If you have movement on the stills you can set up expressions based on in and out points. That's what I do. I then drop all my stills in order into a comp then set the out point for all stills for the longest duration. I then set group colors for layers that I want to make different lengths, do a group select and then adjust the out points for those layers. When I'm done I sequence the layers using the keyframe assistant.
    The other way I work is to use an audio track with markers for timing. I have an expression that reads the markers and sets opacity for the layers based on pairs of markers. The motion is also controlled by expressions. That's an even faster way to set up an animated slide show.
    The last way I work is just to set in an out points for all layers, sequence the layers, use expressions to do the motion and then use time remapping on a pre-comp to adjust the timing of the slide show. All methods are quick and easy.
    Here's a fly in bounce and then drop out fxx preset that will give you an idea of how expressions based on in and out point work for slide shows. You just drag the layer to it's resting position, apply the animatiokn preset and the layer flys in, bounces, and then drops out the bottom of the comp. Works in 2D and 3D space.

  • HT201371 does touching the home button wakes up the iPhone 5s or do we physically have to Click on Home Button or Sleep/Wake button and then use touch id?

    does touching the home button wakes up the iphone 5S or do we physically have to Click on Home Button or Sleep/Wake button and then use touch id?
    What I am trying to say is that each time I have to click on the home button to wake up the iphone 5s and then it scans my print and logs me in the phone however I was hoping that by just putting the finger on the button will do the whole thing of waking up + unlocking the phone,
    Can anyone please let me know if I am wrong or if I am right? since I just bought iphone 5s and I am not sure if the sensor is working or not the way it should be.

    It sounds like it is working the way it should be. You do have to click one of the two buttons. The closest thing to doing it as a single operation is to click the Home button but don't remove your finger from the button (i.e., leave your finger lightly on the button immediately after clicking it).

  • Is there any where that I can voice why I returned my beloved new Ipad? I was told I could move my Keynote presentations to it and then use it for my business presentations. Unfortunately that turned out to not be true. I need the IPad to work with a remo

    Is there any where that I can voice why I returned my beloved new Ipad? I was told I could move my Keynote presentations to it and then use it for my
    business presentations. Unfortunately that turned out to not be true. I need the IPad to work with a remote.
    The Ipad is on a short cable to my projector. I am usually on a podium 30 feet away. No infra red receiver on the IPad and
    the Iphone remote needs wi fi which is not always available in all the locations I do my teaching and lecturing in.
    If you can build a remote into the Ipad in the future I would really like to use an Ipad to replace my heavier lap top for business travel. Thank You Kathy McNeil.

    "The Ipad is on a short cable to my projector."
    Get a longer cable?

Maybe you are looking for

  • Out Of memory in prod

    One of the prod clusters is running on below crashed both nodes with an out of memory exception which looks like below. How do we get to know if the crash is due to a memory leak in the code or elsewhere? Any inputs which helps to identify on the iss

  • File Save Dialog Box Option

    Hi Experts,   Is there any Function Module or options available to save the contents of one Internal Table , by Browsing the Windows drive & Giving the File name. FILENAME = "C:\TEST.TXT   CALL FUNCTION 'WS_DOWNLOAD'          EXPORTING              

  • Java Question

    I have manually installed Java for OS X 10.7 but I still get an error message saying I need the latest version when trying to print from a Java platform.  Updating from apple has not found any update. Any suggestions?

  • Can I make moving Chapter titles in iBA 2?

    I would like to make chapter and section pages move. Text on that page should transition from left to right,... like in keynote. But I would like that it starts automaticly, without touch. I know that there is no such possibility in iBA2. Does anyone

  • Apple Mail issue

    Good day. When I forward a message with some attachments (files has Russian filenames) from iPad to some person, he receives the message in Msft Office Outlook 2007, but the message body has wrong encoding (koi8-r) and the files changes to the follow