I have a field containing data in this format
01Apr04:12:34:56
for example
It is not recognized as a date by Access, so it is stored as text
I need to put it in any general date/time format, like
dd/mm/yy hh:nn:ss
I also need that Access actually reads it as a date/time (not a string) to be able to merge with other data, then sort chronogically.
How can I do that (please no code, only query if possible, i'm really a newbie...)
The dates in my table are strings that appear as 12305 (1/23/05) and so forth. So some are 5 and some are 6 digits depending on the 1 or 2 digit month. I want to convert them in my query to a date field. I think I have to use the DateSerial and extract the parts of the date, but that leading 0 that is not there is throwing me off. Any easy solutions?
I am trying to create an order ID field based on the 1st 3 letters of the name of the buyer and the date of purchase. For example, if the buyer is James, I want the order ID to become JAM010112 (If the date is 01/01/12). How do I go about doing this?
In my query I want to extract the last 10 characters of a string in a column which represent a date in the format DD.MM.YY and then convert these to a real date format to be available for further processing.
My query looks like this:
SELECT Angebotskopf.[Laufende Nummer], Angebotskopf.Angebotsnummer, Angebotskopf.Angebotsdatum, Angebotskopf.Anfragedatum, Angebotskopf.Kunde, Angebotskopf.Ansprechpartner, Angebotskopf.Telefonnummer, Angebotskopf.Faxnummer, Angebotskopf.Projekt, Angebotskopf.Preis, CONVERT(varchar(10), RIGHT(Angebotskopf.Projekt, 8),104) AS TestAngebot FROM Angebotskopf;
But Access gives an error message "unknown function 'CONVERT'"
The "RIGHT" functions works but the resulting column is not being recognized as a date, it is a only a string and therefore useless for processing of any date related calculation.
I have a string value that comes out of a query in the form of
01012015 02012015 12012014
etc...
where the first 2 digits are the month, the next 2 are the day, and the next 4 are the year.How do I convert these values to a valid date that can be queried on?
I have a database with a query that returns a list of printers. This is created by finding all the printers in the database that take a perticular cartridge by code. Sample below.
PrinterName ----------------- Some Printer 1 Some Printer 2 Some Printer 3 ETC
What I want to do is take the results from the query and convert it into a single line of text and place it into a column of a table related to that cartridge code.
So if say the cartridge code '12345' returns a list of printers such as;
printer 1 printer 2 printer 3
I want to take this data and turn it into a line like this;
printer 1, printer 2, printer 3
I then want to take this new line and place it in a column called Desc in another table relative to the original cartridge code.
table should look like this after query. BEFORE: CartCode | CartDesc | Price | Desc 12345 | Something here | 10.00 |
I have a field on my Report called Revenue. It is used in a calculation and there is a calculated field called Profit. Revenue-Cost=Profit. That all works.
The only thing that is wrong is that the Revenue field displays its numbers like this:
0.7 12.43 4.3 0
etc.
i.e. not formatted for currency. But I don't get the currency option under Format. It is based on a Query and this Query is based on a Linked Table.
Any suggestions on how to get it formatted as currency while still having the calculated field working?
I have a field in my database which captures either single digit numbers or comments in text format. I want to be able to count the numbers but obviously I've had to use a memo field in order to capture both numbers and text.
The only way I can think of is to take the field and look for single character responses, then convert these into a number field so that it can be counted.
I have two tables Atable and BTable and both have a field called AcctNo. In Atable, it is type of Number and in BTable, it is type of Text. When I do a join with these two tables
select * from Atable, BTable where Atable.AcctNo=Btable.AcctNo
I get error saying "type mismatch".
My question here is: How can I convert a type from number to string or string to number in my sql statement?
I have a form that takes input to the first, indexed, field from a barcode reader (and keyboard at a pinch). The data coming in has always been numeric so I have several checks in place to ensure it is numberic (field specification) and also that it lays in a predefined range. All works well! I've now been asked to enable this to work with a single letter prefix e.g. T1234567.
As there are many forms which use this same field I'd like to keep it numeric and as the prefix won't change I can add it later using a query. Is there a way to programatically strip the first letter from the string and use CLng() to convert to numeric using the on entry Event Procedure? All my other validation is here but I can't see a way to do this. Failing that, can I use an unbound text box to take the entry and set the index field?
I have an expression that converts a string to positive/negative number. It seems to be working fine, however, it doesn't convert "00000000001}" to -10. It shows as 10.
This is the formula that I am using in my query:
PJUNAccrual: IIf(Right([PJ_ACCRUAL_ADJ_X],1) Between "J" And "S",-1,1)*(Val([PJ_ACCRUAL_ADJ_X])/IIf(IsNumeric([PJ_ACCRUAL_ADJ_X]),100,10)+(IIf(Right([PJ_ACCRUAL_ADJ_X],1) Between "A" And "I",(Asc(Right([PJ_ACCRUAL_ADJ_X],1))-64)/100,0))+(IIf(Right([PJ_ACCRUAL_ADJ_X],1) Between "J" And "S",(Asc(Right([PJ_ACCRUAL_ADJ_X],1))-73)/100,0)))*100
I have been trying to convert string into double number format. I am running a SQL query in VBA that returns a double number format; however my understanding with SQL queries in VBA is that they return string only. The results are showing up perfectly fine when I run the query in the query editor; however when I try using the returned value in further calculations in VBA I keep getting a "Type Mismatch" error.
I am in the process of building a new database in SQL to replace my MS Access database. However, I will continue to use the Access forms, queries, and reports. The new tables will house much of the same data. In multiple tables I have hyperlinks that were created and added in the original Access tables. To import these hyperlinks into the new SQL tables I have converted them to 'Long Text' before exporting, thus changing them into strings.
For example:
Hyperlink - Email - Add Additional Mailbox to Outlook (2010) has been changed to:
Email - Add Additional Mailbox to Outlook (2010)#ServernameServerfolderDocumentationRea dy to GoOutlook TemplatesEmail - Add Additional Mailbox to Outlook (2010).oft#
The obvious issue that I am running into is that after the SQL database table has been linked to the Access database it still displays the entire string when I open the table. The form has a textbox and search button that is used as a search function. This runs a query that returns all "search results" for the desired information. Is there a way that the query can convert the string back into a hyperlink so that the query displays just Email - Add Additional Mailbox to Outlook (2010) as a hyperlink and not the entire string?
I'm trying to create an update query that prompts the user to enter the "Update to" value. The field I am trying to update is a "Yes/No" check box field. When using the following code it because I don't have quotes around the default value "Yes" it inserts "-1" so it works, however the users of the database don't/won't know that "-1" is a yes value and "0" is a no value, so I'd prefer that they could type in text as "yes" or "no" instead:
Eval("InputBox(""Do you want to Complete Update Check Box?"",""Updates Completed?"",Yes,4000,2000)")
Is there a way to convert the "Yes" entered into the Input Box by the user to a "-1" or "0" value behind the scenes so that it will update the field in my table?
When I hook this exact code upto an identical SQL database, it works perfectly. However when I use it with my Access database, I get the messagebox error:
"Data type mismatch in criteria expression."
Can anyone help me correctly format the query statement so that it will work?
Hi there. I'm just jumping into Access and have the following question. In my Purchase Order Table, I have a date field calcualated as text, i.e. "01/12/04". I need to convert this to a date format in my queries so I can do calculations, i.e. 01/12/04 - 01/05/04 = 7 days. Can someone help me with how to convert this text date to a date format. Sorry if this is an easy question. - AJS
This is my first stab at this and I'm obviously overlooking something. I'm trying to do a recurrent date append to an Access calendar db. I'm trying to take the field varStartDate and add 7 to it for the # of weeks recurring. Works great. I type the var out and it is appending correctly BUT when I look at the db, it is putting the ORIGINAL START_DATE and not the RecurDate var. What am I doing wrong?
TIA! Lisa
Dim strSql startDate = CDate(Request.Form("varStartDate")) IF Request.Form("numWeeksRecur") > 0 THEN Weeks = Request.Form("numWeeksRecur")-1 ' *** Subtract week from total week for first Command.Execute For recurDate = startDate To startDate+7*Weeks Step 7 fldStartDate = recurDate fldStartTime=Request.Form("varStart_Time") fldEndDate=Request.Form("varEnd_Date") fldEndTime = Request.Form("varEnd_Time") fldeventTitle=Request.Form("txtEvent") fldevt_grp = Request.Form("txtgroup") fldlocation = Request.Form("txtLocation") strSql = "INSERT INTO events (start_date, start_time, end_date, end_time,eventTitle, evt_grp) VALUES fldStartDate, " 'FOR DEBUG ONLY Response.Write(fldStartDate) & "<hr>" Response.Write(recurDate) & "<hr>" 'Response.End MM_editCmd.Execute strSQL Next END IF
I have a form in which users enter a start date and an end date to reserve meeting rooms. The restriction is that the dates have to be within one year of today's date. The message box saying the same should come up & restrict users from entering the dates. How do I accomplish this? Thanks,