Queries :: Checking Format (Identity Of Field)

May 28, 2013

I've got a database with an 'address 1' field. Sometimes if it's just a number, excel formats the field as a date. Is there anything to check the field to identify any that are showing as dates as opposed to just normal fields. For example identify all customers who have some variation of dd-mm-yyyy in the address-1 field.

View Replies


ADVERTISEMENT

Queries :: Format Field In SQL

Aug 28, 2013

If I'm working strictly from SQL, is there a way to format a field as currency, standard number, etc. without using the format() function? Basically the equivalent of setting the format in the property sheet in design view, without going to design view.

View 1 Replies View Related

Queries :: Change Field Format Within A Query

Sep 23, 2013

I'm having a format problem. I have a query (Q1) that, among other things format a date field as YYYYMM (Field1).

I have a second query (Q2) whose data source is Q1.

In Q2 I need to link Q1 to a table but Field1 is being reformatted as text (confirmed by running a make table query).

I want Field1 to be Number format to eliminate a mismatch error.

I know how to change the format of a field in a table using VBA but I cant seem to find a way of changing the format within a query.

View 2 Replies View Related

Queries :: Format Expression Field As Currency

Jun 4, 2014

I have this expression I created and I want to know how to format it as currency. I know how to do it with a regular field but the option is not available for an expression.

The expression:

Code : Charge: IIf([Rate] Is Not Null,[Rate],"0.00")

View 1 Replies View Related

Queries :: Condition Format A Date Field

Aug 9, 2015

condition formatting a date field in access.The query used for this field produces a date or "NA" based on the formula below. so when the date shows up as "NA" then i have set the condition formatting of the cell to grey and this works works well. but when it shows up with a date it doesnt format to a grey.the formatting pane has these two expressions

1. Q_Induction_Date = "NA" then grey the cell

2. Q_Induction_Date < DATE() then grey the cell and this DOESNT work. i have also tried the function Now() and that doesnt work either.

Formula i use in the query is

Q_Induction_Date: IIf([y].[INDUCTION_NA]=-1,"NA",IIf(IsNull([induction_date]),"NA",Format([induction_date],"dd/mm/yyyy")))

View 4 Replies View Related

Queries :: Changing Field Format In Append Query

Dec 3, 2014

I am using an append query to move data into another database. One of the fields being imported is a date field in text form (20141201). I need it appear in the final database in text form (01/12/14) I have tried using several date conversions and cant get this work. Ideally i need the final value as a text rather than date.

View 8 Replies View Related

Queries :: Format Field As Password Or Hidden Text

May 22, 2014

I have a query that I am sending as a spreadsheet to various service technicians listing parts that they need to take inventory of. Then, after they take the inventory, they send the spreadsheet back to me and I upload their counts back into my database. Right now, my query contains the Bin number, part number, part description, and a blank column for the technician's count. I have just learned, that the company does not want the Bin number to be visible in the report. In order to upload the technician counts into the database when they return the spreadsheet, I need to be able to reference the Bin number to get the count on the right line.

Is there something that I can do so that the Bin number will be visible in the report when the database reads it, but not to the technician?

The only solution I could think of was to format the Bin Number as a password. Unfortunately, I can't get that to work in the query results. If I save the bin number as a password in the table, is there a way to make it visible on reports for internal use (so the people in headquarters who are responsible for over all inventory can still see each bin number)? I found how to hide the field in the query results. However, when I send the results to the technician, the field is not there at all.

View 5 Replies View Related

Queries :: SQL Code To Define Field Format - Mismatch

Dec 1, 2014

I have created an union query to pull together the same data from 2 ODBC tables (seperate countries).As there is a clash in the client number I have added a "N" prefix to differentiate NZ from Australia, as below:

The problem I now have is that I get type mismatch when linking to another table. How could I change the SQL below to dictate the field format to number (providing it will accept the "N" prefix) or all to text?

SELECT dbo_ClientMaster.ClientNumber, dbo_ClientMaster.Name, dbo_ClientMaster.AddressLine1, dbo_ClientMaster.AddressLine2, dbo_ClientMaster.AddressLine3, dbo_ClientMaster.AddressLine4, dbo_ClientMaster.TradeCode, dbo_ClientMaster.ReviewLimit, dbo_ClientMaster.ClientStartDate, dbo_ClientMaster.TypeOfTrade, dbo_ClientMaster.NextReviewDate, dbo_ClientMaster.LastReviewDate, dbo_ClientMaster.TerminationDate, dbo_ClientMaster.TerminationReason, dbo_ClientMaster.BankSortCode, dbo_ClientMaster.BankAccountNumber

[code]....

View 2 Replies View Related

Reset Identity Key

Mar 15, 2007

Hi there....

How can i reset the identity key?

Thanks
Danny

View 5 Replies View Related

Insert... ; Select @@identity

Feb 19, 2006

I work with project access (*.adp)

I want to know if it possible to take the last ID after the sql INSERT QUERY

my code:

strSQL = "INSERT INTO missionFather ....."
DoCmd.RunSQL strSQL


thanks!

View 2 Replies View Related

Login Identity Issue

Feb 12, 2006

I have this form that searches a table to find a unique username for the user. Let me be clear this is not the primary key, but it is as unique since there can not be more than one in table. What i have been able to do is search the table and retrieve a unique id. Example jason brown comes into your company
Fname = jason
lname = brown
what the code will do is create a user id based on his name. the first typical id will be jbrown, but lets say in this insistance jay brown is taken. will what my code does is it returns jabrown. the problem i am having is that i want to find out how to output the name of the user who has the orginial name. example jabrown is returned for jason brown, now a subform will return the current information:

John Brown, jbrown, table1, and the list could go on. This is where i am stuck, i get an error.
Code:Private Sub btnUserID_Click()On Error GoTo Err_btnUserID_Click' this module is designed to check and return a unique user id.' If a user id is not unique enough it will continue to add characters until either there are no more' letters to count or it finds the unique id desired.Dim strUsername As StringDim booMatch As BooleanDim intChar As IntegerCurrentDb.Execute ("delete * from tbl_temp")booMatch = FalseintChar = 1 'defines how many characters to count forstrUsername = Left(Me!txtFname, intChar) & Me!txtlname 'statement counts the first character in the first name and combines it with the last name. Do While booMatch = False 'boomatch is false since it will asume the record is not present booMatch = IsNull(DLookup("[Username]", "tbl_Users", "[Username] = '" & strUsername & "'")) 'Here since boomatch will be assigned the value of the new username entered. 'if a value is equal then a value of true will be returned If booMatch = False Then ' since no match has been found yet boomatch continues meet criteria Dim firstname As String firstname = "SELECT tbl_users.[fname]" & _ "FROM tbl_users" & _ "WHERE tbl_users.[username]='" & strUsername & "';" CurrentDb.Execute "INSERT INTO tbl_temp (UserFirstName, UserLastname, username) VALUES ('" & firstname & "','" & [txtlname] & "','" & strUsername & "');" intChar = intChar + 1 'Boomatch will add one more character to char to move to the next letter strUsername = Left(Me!txtFname, intChar) & Me!txtlname 'this line will assign a value of username to strusername End If LoopMe.txtUsername = strUsername ' user name is assisgned to our VB text boxIf intChar > 1 Then ' if our word counter is greater than one then the following values are visible Me.txtintchar = intChar Me.txtintchar.Visible = True Me.lbintchar.Visible = True Me.Form2.Visible = True Else 'if it is 1 or less are values will be false Me.lbintchar.Visible = False Me.txtintchar.Visible = False Me.Form2.Visible = FalseEnd IfForms![form1]![Form2].Form.RequeryExit_btnUserID_Click: Exit Sub Err_btnUserID_Click: MsgBox Err.Description Resume Exit_btnUserID_Click End Sub

the highlighted part is where the code does not seem to be working.

View 1 Replies View Related

Checking A # Field

Sep 4, 2006

Hi guys, a company in my city is giving out prizes, and for each buy you get a sheet with 25 numbers ( kind of bingo thing). Well I have like 300 sheets . So i did an Access where I enter the SheetID and the 25 numbers. Now I have to do another table where I can insert the number that will be draw and whenever one of the sheet is complete, it let me know that I win!!! and the SheetID.
Any ideas!!! please please

View 1 Replies View Related

Set A Value In A Field By Checking A Box

May 13, 2005

Hi,
i want to set values (=numbers) in fields of a table by selecting check-boxes in a form (based on the same table).
as checkbox1 =1
checkbox2= 2
etc
If the box is checked the value should be entered, if unchecked the value should be removed.
Afterwards i want to show the sum of these values in another field in the same form.
I suppose this requires VBA. Could anybody help me plz ?

Thx

View 3 Replies View Related

Checking Field For A Value

Jan 17, 2006

I've had a search in the threaqds for an answer but cannot find anything specific, plus this one has stumped me.

What I need to do is check if a certain field has a value if another field has a specific value ??!!?

Ok so if Combo Box 1 is set to 1, then Combo box 2 must have a value selected.
If ComboBox 1 is set to 2, then Combo Box 3 must have a value.

for any other value for ComboBox 1 box 2 & 3 do not require a value.

If either of these statements are not correct then a message box should come up

Any help would be greatly appreciated

MattP

View 5 Replies View Related

Calculate Age Using Persons Identity Number

Apr 25, 2012

I am using 2010 and have a bound field called Policyholder ID number in a table called Policy Information. I would like to calculate how old a person is by using the identity number which is 13 digits (South African ID) and the format is as follows - 7009215069084. Using the first 6 digits this person was born on 21 Sept 1970 and is 42 years old ( Current year of 2012 minus year of birth of 1970 = 42)

How I can include a calculated field so once I type in the identity number the age of the person reflects in a field called Current Age.

View 13 Replies View Related

Checking Empty Field

Jan 22, 2007

Im trying to check if a field is empty (i.e hasnt got anything in it)- but how do i do this. Ive called the field in my sql statement and then Ive put it in a variable- i,
I am then running a if statement

Code:If i = "" theni = "1" ElseEnd If

But this is not working?????

View 4 Replies View Related

Checking For Strings In A Field

Feb 16, 2008

Hi
I am trying to read a large file and to check if the phone number field is valid.
If there are more than 6 "1"s, "9"s or "0"s in the field, then I want to replace it with a null otherwise, I will treat it as a valid number.
Can you help?
Noel

View 7 Replies View Related

Forms :: Assign Field With Special Format Based On Date / Time Format

Feb 17, 2014

I wanted to assign the field "Number of magazine" with special format based on date/time format but showing only year and month in the format: "yyyy-mm".

So in property of this field in format I put yyyy-mm and in input mask I type 0000-00;;-

I also created the form based on the table containing above field and I defined format and input mask for corresponding formant in the same way like at the table.

But if I try to type date for example 2014-01 in text box of the form it comes up with the full date 2014-01-01. Why does it do like this? What do I do incorrectly?

View 2 Replies View Related

Queries :: Checking If Type Is Present In Table

Mar 21, 2014

I have 3 tables:

- tbl_Positions {containing information on a specific job role}
- tbl_Office {containing information on an office}
- tbl_StaffDetails {containing information of all staff in the company, including a relationship with tbl_Office to say which office they are working out of}

I want to do a simple query saying what type of staff are working out of each office:

e.g.

If in Office 1 I might have a managing director, CEO and 2xOperations managers etc.

If in Office 2 I might have 5xAdmin, 3xHR, 6xIT Support etc.

What sort of query can I run to return just a list of job titles for those present in the office I choose.

View 2 Replies View Related

Queries :: Checking For Special Characters In Descriptions

Mar 12, 2015

I want my to detect special characters in my descriptions that are not found on keyboard and display as error.
Tried using the following

Description check: IIf([Common Description] Is Null Or [Common Description] Not Like "*[!a-z0-9@=.^_$%!#&'`(){|}*?~[]/-]*" And [Description Local] Is Null Or [Description Local] Not Like "*[!a-z0-9@=.^_$%!#&'`(){|}*?~[]/-]*","<<Error Desc>>","OK")

but when i tested it using some data, it shows all as <<Error Desc>>

some of the special characters i want to check for are βuΩ etc.

So if my description contains characters that are not: a-z OR 0-9 or any of the following ~!@#$%^&*()_+=-`][';/.,<>?:"{}|~

it will return <<Error Desc>>

View 4 Replies View Related

Queries :: Checking That All Matching Fields Are True

Mar 21, 2013

For my query I have 3 tables.

TEAMS. This contains TeamID / TeamName and TeamManagerName.
TeamAPPLinks. This is a many to many relationship and contains TeamAppID / AppID and TeamID (TeamID links to Teams.TeamID and AppID links to Applications/AppIS)
Applications. This contains AppID / AppName / Pass/Fail.

So teams can have many applications and applications can have many teams.

I only want to show teams that have all applications that have the Pass/Fail column as PASS. I have managed to do this for FAIL runing a query in a query but obviously its different for PASS as all associated applications have to be a PASS, not just one FAIL for a FAIL.

View 4 Replies View Related

Error Checking And Multi Field Searching

Sep 17, 2007

Morning all,

Quick question... I figured out how to make all the searching items work... individually. The problem is is that I want to be able to search with two fields at a time. For example, say i have mo, date, job, pay and i want to seach for the MO and JOB and query the results accordingly. I can't get it to do that. Would I have to make a large If statement? I'm not entirely sure. Also now my problem is that it won't execute my first if statement or I should say it ignores it all togeather. I know it executes the code in the order it is written. If someone could shed some light I would be much apprecative. As always here is the code and attached is the program. What I'm working on is in the query table.

I also would like to be able for it to say if the fields MO and JOB do not comeup witha result for a messege to display there is no result. Or if the field is null not to do anything. I tried doing that in some of my code to no success perhaps I did somthing wrong.

Have a great day!


Dim strSQL As String
Dim sqlStringWHERE As String
Dim strhead As String
Dim strJOIN As String

' strSQL = "SELECT * from Panel WHERE MO like " & Chr$(39) & "*" & Me.qMO & "*" & Chr$(39)
strJOIN = " AND "
strhead = "SELECT * from Panel "

If Len(Me.qMO & vbNullString) Then
sqlStringWHERE = "WHERE [MO] like " & Chr$(39) & "*" & Me.qMO & "*" & Chr$(39)
Else
sqlStringWHERE = "WHERE [MO] = " & Chr$(39) & Me.qMO & Chr$(39)

sqlStringWHERE = sqlStringWHERE & strJOIN

End If

If Len(Me.qCode & vbNullString) Then
If Len(sqlStringWHERE) = 0 Then
sqlStringWHERE = "WHERE "
End If

sqlStringWHERE = "WHERE [CODE] like " & Chr$(39) & "*" & Me.qCode & "*" & Chr$(39)
Else
sqlStringWHERE = "WHERE [CODE] = " & Chr$(39) & Me.qCode & Chr$(39)

sqlStringWHERE = sqlStringWHERE & strJOIN
End If


strSQL = strhead & sqlStringWHERE

View 7 Replies View Related

Modules & VBA :: Checking Null Values In A Field

Jul 10, 2014

The following code doesn't check null condition in Scannedby field. The scannedby has text data type. The code gives me all the data where scandate=20130722 but doesn't check that scanned by can't be blank.

Code:
rs.Open "select count(*) from BatchTBL2 where scandate=20130722 and scannedby <> null", cn, adOpenKeyset, adLockOptimistic
j = rs.fields(0).Value

View 5 Replies View Related

Queries :: Checking Query For Null And Setting Operations

May 30, 2014

I have been working on an application where I am collecting survey data in a database. There are multiple survey tools available to the user, and it's possible to complete multiple survey tools in the survey.My problem is, it's possible for the surveyor to complete some tools on one day and other tools on another day. I am having problems with trying to figure out how to add a tool that has not been previously added and keep in the same survey which is all held under a single Survey Number.

The first step in the function is to set a Record Number temporary variable based on whether or not the tool has been used (it's possible to use multiple instances of a survey tool, so need to know if the Record Number is '1', or the next number in the sequence.I've been trying to do this by checking a query for a Null and setting the temporary variable using something like:

IF ISNull("RecordNumber","qryRecordHeader") Then '1'
Else
DLast("RecordNumber","qryRecordHeader") +1
End IF

The second half works just fine, so if there is a previous record, it will add. But if it's Null, it doesn't work.I'm trying to avoid opening a temporary form to run the query and checking a field. Is there a way around that?

View 3 Replies View Related

Modules & VBA :: Checking If Data Entered In Form Field Exist

Jan 17, 2015

I want to check if data entered in a form field is existed

The form is bounded to a table

I used this code

If DLookup("Telegram_Number", "tbl_Violation_Of_Building", "Telegram_Number Like " & Forms!frm_Add_Violation_Building!Telegram_Number) Then
MsgBox ("number existed")
Me.Telegram_Number = ""
Else
End If

everything is ok but if the data is existed the database show the message and clear the field but i'm getting a Run-time error

'-2147352567(80020009)': the macro or function set to the beforeupdate or validationRule property for this field is preventing [ISF] from saving the data in the field

I guess the problem because the form is bounded to a table so he will save automatically

My solution is to unbound the fields and save the data via vba but is there any solution with a bounded form???

View 3 Replies View Related

Modules & VBA :: Checking Checkbox (from Multiple Checkboxes) Based On Field Value

Nov 29, 2013

I have a field 'Payment Types' with values (Cash, Cheque, Debit/Credit Card) and a field 'Payment Received' which is Yes/No.

When putting the order through the user selects the payment type and ticks a box if payment has been received.

On a report for delivery drivers, the owner wants it simple for the driver... he wants all the payment types listed with a checkbox next to each one, then wants the appropriate box ticked if payment has been received.

So I need something on the report (or underlying query) which ticks the appropriate box, i.e.

If payment received = true then payment type checkbox = true.

Or should I put the payments into a separate table with both fields so multiple payment types can be marked as paid?

View 6 Replies View Related







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