473,378 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

SSN Format query

I have a query, here is a brief snipit:

SELECT Employment.PERSON_ID, Person.FIRST_NAME, Person.MIDDLE_NAME,
Person.LAST_NAME, Person.[SOCIALSECURITY#] AS SSN, ....

I want to return only the last 4 digits of the SSN. Can the below
snipit be incorporated into the above query?

something like: SET SSN = Right$(Replace(SSN,"-",""),5)

thanks!!!

May 10 '06 #1
1 4016
Parasyke wrote:
I have a query, here is a brief snipit:

SELECT Employment.PERSON_ID, Person.FIRST_NAME, Person.MIDDLE_NAME,
Person.LAST_NAME, Person.[SOCIALSECURITY#] AS SSN, ....

I want to return only the last 4 digits of the SSN. Can the below
snipit be incorporated into the above query?

something like: SET SSN = Right$(Replace(SSN,"-",""),5)

thanks!!!


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Don't use the SET, just use the expression in the SELECT clause:

... Right(Person.[SOCIALSECURITY#],4) AS SSN, ....

Since the SSN has 4 numerals as the last 4 digits you don't need to get
rid of the dash "-" before plucking those numerals from the SSN.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRGEc9YechKqOuFEgEQKXbwCfW78JlagWUWVVieoEqiwIIf BQuFQAniwp
LEXYO0C56REP6EM2ZSNQMgUo
=9laY
-----END PGP SIGNATURE-----
May 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alistair | last post by:
it's the idiot with his query strings again...."yippeee" I hear aaron shout this time the problem is with a date format query I have a query string thus strSQL = "SELECT * FROM users where...
0
by: Ajit Singh | last post by:
Hello Gurus, Need your help on following: 1. Whether an MDX query be stored in an XML format? e.g. can the below query be stored in an XML file format: (the query is for illustration only). ...
2
by: DD | last post by:
I have a UnionQry that is run from StatementsI and StatementP. the Due and Paid colunms are currency and show the $ however when i union the two the currency format has gone. Any help please...
3
by: Melissa | last post by:
What specifically causes the Format event of a report's section to fire? Thanks! Melissa
5
by: Macca | last post by:
Hi, I have a table which has a date/time field. I am storing them as follows :- 01/01/2005 11:25 01/01/2005 19:44 02/01/2005 05:04
3
by: Jean | last post by:
Hi, I have a query that contains the following in the WHERE part of the query: WHERE....Format(IIf(nz()<>0,, IIf(nz()<>0,, IIf(nz()<>0,, ))),"0.0") AS Körperhöhe,....
5
by: veaux | last post by:
I'm thinking this is easy but can't get it. I have a table with following: Table1 Date 1/1/2007 Table2 Type 0107 (This is MMYY of above) So I'm having trouble using a query to turn the...
2
by: thewilldog | last post by:
Hello, I've reviewed the archives here to address the issue, but I'm still running into problems. I've got a table field populated with the record date in text "YYYYMMDD" To convert it into a...
2
by: Dhananjay | last post by:
Hi all , I have got problem when i am tring to exportGridview Data into Excel format. It is going into text format ,but what i want is if the field is number/currency then it should go into...
6
by: phill86 | last post by:
Hi, I am trying to run a query on a date criteria the date data in the table that I am searching is in this format dd/mm/yyyy hh:mm I need to have the date in this format for various reasons. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.