SQL Query just try substring function. Praveen pvs <[EMAIL PROTECTED]> wrote:Hi, Just use LIKE '%' + @cardnumber eg: if exists(cardnumber) from xx where cardnumber like '%' + @cardnumber) begin ...... end bye, Praveen P.
On 10/4/05, Parimala Renganathan <[EMAIL PROTECTED]> wrote: > > eg cardnumber = 0987654321 > > try this one > > Mid(cardnumber,7,4) will returns 4321 > > > sas0riza <[EMAIL PROTECTED]> wrote: > Hi, > > I want to take 2 inputs (email, number) and search for it in the > database. If I find the email, I then want to compare the "number" > (e.g. 1234) with the cardnumber associated with the email that was > found. Note that the cardnumber is of type char(10). > > e.g. Table1 (holds all inputted data), Table2 (has a bunch of > records) > > input (email) = [EMAIL PROTECTED] > input (number) = 1234 > > In Table2, [EMAIL PROTECTED] is found and cardnumber associated with > this email is 5440121234. > > Now I want to compare the input number 1234 to the last 4-digits (or > last 4 char position) of cardnumber 5440121234. If it matches, then > I want to take cardnumber and insert it into Table1. > > > How would I go about doing so? charindex? or? > > Please advise. > > Thanks. > > > > > > SPONSORED LINKS > Basic programming language Computer programming languages Programming > languages Java programming language The history of computer programming > language > > --------------------------------- > YAHOO! GROUPS LINKS > > > Visit your group "AspNetAnyQuestionIsOk" on the web. > > To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > > > --------------------------------- > > > > > --------------------------------- > Yahoo! for Good > Click here to donate to the Hurricane Katrina relief effort. > > [Non-text portions of this message have been removed] > > > ------------------------------ > YAHOO! GROUPS LINKS > > > - Visit your group > "AspNetAnyQuestionIsOk<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk>" > on the web. > - To unsubscribe from this group, send an email to: > [EMAIL PROTECTED]<[EMAIL PROTECTED]> > - Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/>. > > > ------------------------------ > [Non-text portions of this message have been removed] SPONSORED LINKS Basic programming language Computer programming languages Programming languages Java programming language The history of computer programming language --------------------------------- YAHOO! GROUPS LINKS Visit your group "AspNetAnyQuestionIsOk" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. --------------------------------- --------------------------------- Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
