thepunisher
Programmer
Hi im creating this query that makes a new field called 'Marginal Unit'.
I want to pick out a specific string in the field D_Data.
I can do this with other queries when i simply want to extract a numeric value, however i want to extract a string like 'David 1'.
When i use the same query to get these strings, the nely create field 'Marginal Unit' is filled with zeros.
I think i need to format this new field when i run the query, so how do i do this?
hope u can help,
'This is the query im using so far...but i think it can be changed in the query designer section....
----------------------------------------------------------
SELECT tblmrpt15x.A_Week_Beginning_Monday, tblmrpt15x.B_Hour_of_Week, tblmrpt15x.C_Row_No_Per_Hour, tblmrpt15x.D_Data, tblmrpt15x.E_Hour_Of_Day, tblmrpt15x.F_Actual_Date, IIf(Mid([D_Data],51,1)="x",Val(Mid([D_Data],26,9)),"") AS [Marginal Unit]
FROM tblmrpt15x
WHERE (((IIf(Mid([D_Data],51,1)="x",Val(Mid([D_Data],26,9)),""))<>""))
ORDER BY tblmrpt15x.A_Week_Beginning_Monday, tblmrpt15x.B_Hour_of_Week;
----------------------------------------------------------
kind regards,
thePunisher.
Chief Dan George-Get ready little lady, hell is coming to breakfast
I want to pick out a specific string in the field D_Data.
I can do this with other queries when i simply want to extract a numeric value, however i want to extract a string like 'David 1'.
When i use the same query to get these strings, the nely create field 'Marginal Unit' is filled with zeros.
I think i need to format this new field when i run the query, so how do i do this?
hope u can help,
'This is the query im using so far...but i think it can be changed in the query designer section....
----------------------------------------------------------
SELECT tblmrpt15x.A_Week_Beginning_Monday, tblmrpt15x.B_Hour_of_Week, tblmrpt15x.C_Row_No_Per_Hour, tblmrpt15x.D_Data, tblmrpt15x.E_Hour_Of_Day, tblmrpt15x.F_Actual_Date, IIf(Mid([D_Data],51,1)="x",Val(Mid([D_Data],26,9)),"") AS [Marginal Unit]
FROM tblmrpt15x
WHERE (((IIf(Mid([D_Data],51,1)="x",Val(Mid([D_Data],26,9)),""))<>""))
ORDER BY tblmrpt15x.A_Week_Beginning_Monday, tblmrpt15x.B_Hour_of_Week;
----------------------------------------------------------
kind regards,
thePunisher.
Chief Dan George-Get ready little lady, hell is coming to breakfast