Left Padding Problem

Mar 9, 2005

Hy,I need help about making this querry.
I have column called 'racun' which is nvarchar.It contains data like:
8456
786669
125222

What i need is to update data from this column to look like this:
000000000008456
000000000786669
e.t.c
I know that i must use left pading function but can anyone show me how to make this querry??

View Replies


ADVERTISEMENT

Add Padding To Phone Number

Nov 27, 2006

I have a list of about 900 phone numbers, which have been formatted in excel to have a 0 at the beginning of the phone number. However when i export the data to access, so it can be viewed on a webpage this formatting is lost.

How best can i go about adding a zero at the beggining of all of the phone numbers in my list? Can it be done using sql or is there another function in access that can do this.

Thanks

View 5 Replies View Related

Using Left Function

Jul 20, 2005

I have a column in access containing codes in format K2316 and wish to remove Prefix (K) from this code.

How can i do this as a calculated field?

thanks

View 14 Replies View Related

Take Left Of Another Column..

Mar 25, 2008

Not sure if this is possible? I have a column called Issues and another column I want to call ShortIssues and I basically want ShortIssues to be Left(Issues,50) so that its just 50 characters long of column Issues.

any ideas.

Thanks,

View 11 Replies View Related

Right Or Left In Query?

Jun 15, 2005

hey,

Is it posible to somehow intigrate this code or some other code that would do the same in to query?

code:
str1 = Right(Me.Text1, InStr(Me.Text1, "Ex") + 2)

I have a table1 with filed "EXZ" and that field contain some data like "7.5/400/Eex de IICT4" now i would like to run an update query on that table and update field "EXZ" from "7.5/400/Ex de IICT4" to "Eex de IICT4". The last part of the data is not allways the same but it does allways start with "Ex"! So is that even posible to do with query or do i have tu use a macro or what?

THX

View 3 Replies View Related

Left Join

Nov 21, 2005

Hi
I am trying to use left join on the following tables.
Employees
----------
EMPLOYEE_ID
FIRST_NAME
LAST_NAME

and

Weekly_Timesheets
-------------------
EMPLOYEE_ID
WEEK_NO
YEAR_NO
TOTAL_HOURS_WORKED

All I want is to pull all the employees with their corresponding total worked hours. There are cases when some employees forget to fill their time sheets in a week and might not have entries in weekly_timesheets table. Since I want all the employees irrespective of whether they have a record in weekly_timesheets or not I am using left join.

The left join I am using is as follows:

SELECT EMPLOYEES.EMPLOYEE_ID,
WEEKLY_TIMESHEETS.TOTAL_HOURS_WORKED
FROM EMPLOYEES
LEFT JOIN WEEKLY_TIMESHEETS
ON WEEKLY_TIMESHEETS.EMPLOYEE_ID = EMPLOYEES.EMPLOYEE_ID
AND WEEKLY_TIMESHEETS.WEEK_NO = 46;


The moment I am trying to execute this statement Access is crashing. I couldn't figure out what am I doing wrong.

Kind Regards
Bhanu

View 6 Replies View Related

Left$ Query

Dec 8, 2005

Left$([Entry timestamp],14)

I want to execute the above sql query but the result is not what i'm expecting.
the field entry that i wan to extract the leftmost 14 characters is
2.005113E+19
instead of just having plain numbers like 2005113009010532000000.....

I think it's becoz of the format that's why Left function is not working as expected. Can somebody help me out regarding this? Thanks very much

Regards
Dominic

View 8 Replies View Related

Left Function

May 17, 2006

Hello,

I have used the left function to provide me with the left x characters of a field, which works fine.

Description: Left([c$products],[diff])

However, I want to query this field to only give me certain descrpitions, but it will not work.
Can anyone let me know if this is possible, or if I'm totally out of luck,

Thanks,

J.

View 4 Replies View Related

Left Join?

Jun 22, 2006

Hi Guys

I'm kind of a newbie to Access but am learning :D
I've found myself stuck with a join statement

I have 2 tables: tblFleet & tblService

I need to find the most recent service date from tblService for each entry under tblFleet....

This is my code thus far, but it shows all the records for both tables where the fleet_Num field is equal....

SELECT tblFleet.Fleet_Num, tblFleet.In_Yard, tblService.SrvDate
FROM tblFleet LEFT JOIN tblService ON tblFleet.Fleet_Num = tblService.Fleet_Num
ORDER BY tblService.SrvDate DESC;

View 2 Replies View Related

Left Join

May 8, 2007

Simple exlusion query:

SELECT tblEmployees.EmployeeID, tblEmployees.LicenceNo, tblTimeSheet.ShiftDate, tblEmployees.FirstName, tblEmployees.LastName
FROM tblEmployees LEFT JOIN tblTimeSheet ON tblEmployees.EmployeeID = tblTimeSheet.EmployeeID
WHERE (((tblTimeSheet.EmployeeID) Is Null));

errrr nope it doesnt work.. and that is direct from the wizard...

I have a work around but it is inelegant not to mention not workable..

what i need to do is filter on a shift date as i need to see what employees are not rostered on particular dates..

what i have had to do is make a query selecting base data from timesheet and filter the date at that point... make another query to do the left join.. again not elegant... to make a report i would somehow have to programmatically adjust the filter on the date.. too hard basket and will be too slow when i have a copious amount of data in 12 months... anyone know what the hell is wrong?

View 5 Replies View Related

Need Some Help With A Left Function

Sep 13, 2007

I have an imported table with zipcodes, some are 5 digit some are 9. When i go to build my query i dont get an accurate number, i tried a left function to get the 1st 5 digits but keep getting a invalid syntax. I am in the query builder. anyone help me with syntax, heres what i currently have

Mail Zipcode «Expr» Left («stringexpr», «n»)

View 3 Replies View Related

Left Join

Nov 14, 2007

Hello

I have a loan db that I want to write a query to reflect all active loans with or without a current month's payments. In other words, I want it to select all active loans even if there was no activety during the month. I have 1 query that pulls out all active loans; qryActiveLoans. I then create a left join (2) with that query Grouping on the Loan# and summing the Principal and Interest fields where the payment Date is between #10/01/07# and #10/31/07#. I need to group on loan the number because some loans have more than one transaction in the month.

The problem is that the query does not select the loans that didn't have any payments during the month. I thought that a left join (2) will pull out ALL the records from the qryActiveLoans query. I've tried adding the word ALL after the SELECT statement but that does not work. I've also tried various forms of nz without success. This is probably a common problem but I could not find it in my searches of past postings.

Any help would be appreciated.

View 4 Replies View Related

Almost There, One Form Left!

Sep 10, 2005

I've created a db for my mortage company and I have everything complete except returning customers. I want the customers to have the same customerID but different TransacionID. Sounds simple to me but im having problems. It could be a table issue but im hoping its just a form thing.

I have tables: Customers-CustomerID(autonumber),CustFirstName,CustLastName, PhoneNumber,EmailAddress,OriginatorID.

Then I have Table: Detail- CustomerId(lookup from customer table),TransactionId(autonumber),SSN,Address,City, State,Zip,Spoucename,CreditScore,

Then I have Table: Loan- TransactionId(lookup from Detail),LoanType,LoanAmount,StartDate,EndDate, LoanLender


I have a form for new customers which is the customer table. Then once the customer has his credit checked we enter the customer details with a form. Then when they want to move forword with a loan there is a form that pulls the TransactionID from the Detail Table.

I cant figure a way to make a form that will create a new transactionID associated to the custs CustomerID without overwritting the older record.

What do I need to do?

Thanks for any help.

Scott

View 1 Replies View Related

Left Pad With A Zero Digit

Oct 6, 2004

Hi, when I type 0600 in a text box, it dispays it as 600. How do I make it so it displays the number that I actually type in, with a zero as the first digit?
Please help. Thank you.

View 6 Replies View Related

Left Join

Oct 25, 2004

Hi,

I am trying to do a left join in ASP but getting error message saying "Syntax error in From clause"
The query runs fine if I have a record for a country in all the tables. But I have certain countries that do not have a
matching record in currency table. For those countries I want the information from the other tables. Following is the
query:

SQL = "SELECT Country.Country_Name, Country.Continent," & _
"Country.GNI_per_capita, Inc_Cons_Distribution.Top_10_percent," & _
"Inc_Cons_Distribution.Gini_Index, Population.Total_Pop, Population.Urban," & _
"Population.Rural, Population.Under_14, Population.Below_Poverty," & _
"Currency.Curr_Name, Currency.Exchange_Rate FROM (([Country] LEFT JOIN Population ON " & _
"Country.Country_Name=Population.Country_Name) LEFT JOIN Inc_Cons_Distribution ON " & _
"Country.Country_Name=Inc_Cons_Distribution.Country _Name) LEFT JOIN Currency ON " & _
"Country.Curr_ID=Currency.Curr_ID where country_ID in(" & countryList & ")"

Thanks in advance.

-GreetInfo

View 1 Replies View Related

Left Function

May 2, 2005

Hi all - I have a database that has only 1 field of patient names (e.g., "Johnson,Peter S"). I also have a form that allows clinicians to lookup their patients and I want them to be able to type in the last name of their patient and get the info they need. Anyone know how to pull just the part of the name BEFORE the comma (i.e., the last name only)? The Left function won't do it because the last names are different lengths.

Also, is there a way to have the form pull all the names after each letter they enter? So when the user typed "J" it would pull Johnson, Jones, Jackowa, etc, but when they typed the "o" it would decrease the list to only Johnson and Jones.

Any thoughts would be great. Thanks.

View 4 Replies View Related

Application Being Left Open

May 19, 2005

I have a shared 2000 db and for the last few days someone has been leaving it open. In '97 you could open the .ldb file and see who it was, is there a way to find out in 2000?

Also, I have seen something on remotely removing users who leave the application open but can't find it now. Does anyone know how this is done? The data must be refeshed daily and hasn't been for the last four days due to this lock.

View 2 Replies View Related

Left And Right Arrow Keys

Apr 13, 2007

I would like to have a event for the left and right arrow keys, does anyone know how to do this?

View 4 Replies View Related

Left, Mid, Right Not Recognized Anymore

May 10, 2007

Hi !

I use access 2000 (french) and runtime access 2000 (english) on XP.
After upgrading workstations with last microsoft security patchs, the use of left, mid or right functions in queries doesn't work anymore.
We know now that the patch acted on MDAC, is it the answer?
I don't know how to make it work.

If you have any idea, it would be great.

LawraC

View 7 Replies View Related

How To Make Read Right To Left

Mar 18, 2005

I have a field within the table in hebrew and want to make it read from right to left. How can I?

Will that be working if I display it using ASP online?

View 1 Replies View Related

Remove Everything Left Of The Dash

Nov 3, 2005

Hello,

I have data that looks like this:

blahblah-need
blah-aneed
blahblahblah-aaneed

I would like to have everything right of the dash to get:

need
aneed
aaneed

I have used mid and instr to get the left hand stuff. I've tried to modify to get the data to the right of the dash and I am lost.

Your help appreciated.

View 11 Replies View Related

Left Joining More Than 2 Tables

Dec 15, 2005

Hi whats the syntax for left joining more than 2 tables if each of the tables has a common column???

View 4 Replies View Related

How To Speed Up A Left Join?

Jan 20, 2006

Hi,
I am doing a Left Join to try to look up values in a large (about 100,000 records) table. If the value isn't found, I'm using the nz function to supply a value.

This query runs very slowly (takes about 2 minutes). I can understand why... I suppose that for every value it's trying to look up , it has to loop through all 100,000 records before it decides that it's not there.

So, I am just looking for ideas on how to make this run faster.

I do have indexes on all my join fields and criteria fields.
Thanks for any suggestions.

Here's the SQL:

SELECT VM1a.row, VM1a.Column, VM1a.Noun, VM1a.Rev, VM1a.RefDes, VM1a.repcode, VM1a.Cell, VM1a.InspPoint, VM1a.DefectType, CLng(nz([FirstOfTruncatedOpSeq],0)) AS ZOpSeq, Sum(VM1a.DefectQty) AS SumOfDefectQty
FROM VM1a LEFT JOIN BOMOutRefDesOnly ON (VM1a.RefDes = BOMOutRefDesOnly.RefDesOnly) AND (VM1a.BOM1 = BOMOutRefDesOnly.PCAItemNo)
GROUP BY VM1a.row, VM1a.Column, VM1a.Noun, VM1a.Rev, VM1a.RefDes, VM1a.repcode, VM1a.Cell, VM1a.InspPoint, VM1a.DefectType, CLng(nz([FirstOfTruncatedOpSeq],0));

View 1 Replies View Related

Probelm With Left Function

Mar 11, 2006

Hi there,

I have a query with Expr3: Left([POK],2) as one of my fields.

Whenever I try to run the query it pops out a message window saying

Syntax error (comma) in query expression.

Please tell me what I am doing wrong.

Thanks in advance.

View 2 Replies View Related

Left Joins And Group By's?

Jun 9, 2006

Hi,

I have two tables:

tblListeners
-----------
ID (PK)
FirstName
LastName
etc

tblReference
------------
ID (PK)
ListenerID
ReferenceTypeID (FK)
ReferenceDate
etc

(Btw I am aware of the unconventional naming of the PKs but I'm running the B/E on SharePoint so I have no choice!)

So listeners have to periodically do a reference. What i want is a query that tracks if listeners either have not done a reference EVER or haven't done one for a while, but broken down by the FK in tblReference.

Here is my reasonably simple SQL so far:

SELECT tblListeners.ID AS ListenerID, tblListeners.FirstName, tblListeners.LastName, tblReference.ReferenceTypeID, tblReference.ReferenceDate
FROM tblListeners LEFT JOIN tblReference ON tblListeners.ID = tblReference.ListenerID
WHERE (((tblReference.ListenerID) Is Null) AND ((tblReference.ReferenceDate) Is Null)) OR (((tblReference.ReferenceDate)<DateAdd("m",-6,Date())))
ORDER BY tblListeners.FirstName, tblListeners.LastName;

In the current query the results ignore the FK so the so a listener will be missing if they have done one type of reference - i want them to be there (or not be there) for each type of reference. Hope that makes sense!

Now i know people may suggest a crosstab for this but: a) I don't get on with them and wouldn't know how to implement it and b) this will need to be in a report and I don't want to venture down the 'dynamic crosstab report' path!

Any ideas?

Cheers,

Bobadopolis

View 7 Replies View Related

LEFT JOIN Problem

Oct 2, 2006

Hi
I have proplem with this sample query

SELECT * FROM sys LEFT JOIN [local] ON [sys].[PK_]=[local].[SYS_PK_]

In the MS Access it is going well but when i try to connect to database from my application through ODBC, and I run query driver returns
recordset with right records count but with EOF=BOF=TRUE

Error appears only when in the left table is record with no pair in the right table

table sys:

PK_;NAME
1;"Name1"
2;"Name2"
3;"Name3"

table local:

PK_;SYS_PK_,DESCR
1;1;"Descr1"
2;2;"Descr2"


Thanks

Milan

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved