User Profile
Collapse
-
Thanks guys! I'am used to writing SQL for a SyBase system which is regular SQL server and there is no need to list the table in the "FROM" statement if that is the one getting deleted from. -
Thats closer Mike, at least the "#" get stuck around the dates. Still getting a syntax error:
"Syntax error(missing operator) in query expression '[ExtractDataActu alStart] WHERE ActualStart BETWEEN #7/24/2007# AND #7/31/2007#'.
The syntax looks good any other ideas why still the error.Leave a comment:
-
Here is the code. It is in the "Clicked" event of a command button.
StartDate = Date
EndDate = DateAdd("d", 7, StartDate)
DeleteSQL = "DELETE [ExtractDataActu alStart] " & _
"WHERE ActualStart <= " & StartDate & " AND ActualStart >= " & EndDate & " ; "
CurrentDb.Execu te DeleteSQL, dbFailOnError...Leave a comment:
-
Date variables in a SQL statement
I have two varaible:StartD ate = Date
EndDate = DateAdd("d", 7, StartDate)
I'am using these to try to retrieve data from a table. What is the correct syntax to use variables of type "DATE" within the "WHERE" clause. I've been trying to use the "Between" option and "<= , =>" when comparing these dates to the DATE column on the table. If I put two actual... -
Mike and JKing, I revisted what Mike posted and retyped it the way he had it and it does work. Once again my big fat fingers get in the way of each other on the keyboard. Thanks guys, you're certainly helping out this newbie.Leave a comment:
-
MTB, Thanks for the response but that doesn't do it. This is a simple insert into a table I created to draw out dates from a table created to load data from a imported Excel file. This code is in the "Clicked" event of a command button. I guess I need to ask is it possible to insert into one table from another table using the actual column names as assigned in the "FROM TABLE". I've been able to figure out the "INSERT INTO"...Leave a comment:
-
SQL INSERT Statement
Having a little trouble with an INSERT statement. I get a runtime error "Missing semicolon(;) at end of SQL statement". This is the INSERT statement:
"INSERT INTO [ExtractDate] ( UniqueID, StartDate ) " & _
"VALUES ( [Unique ID] , Actual_Start )" & _
"FROM [AIS Release and Transport Status]" & _
"WHERE Actual_Start <> 'NA' ; "... -
-
JKing, I have there different reports to create. The reports are based on dates ranging from todays date to one week, two weeks or 4 weeks out depending on which one the user selects. There is two columns (Actual Start and Forecast Start) on the table in which to compare these dates. The first column "Actual Start" is a text field which can have a date type format (ie "07/20/2006" or an entry of "N/A" which is why the...Leave a comment:
-
Thanks for the reply but thats not what I'am looking for. I know you can code a Case statement in VBA script (say to use in the click event of a button) but I was wondering if you can use a Case statement within a sql query script for a report.Leave a comment:
-
SQL Case Statement for a report
Is it possible within Access 2003 to use a Case statement in the query sql that returns info for a report. I mostly work with a Sybase database system which allows such commands. Can't find any references as to whether this is legal in Access. If so, could you possibly include a sample of its usage(syntax) or a place to go and find an example. Thanks for any and all replies. -
Thanks for the response guys, I got it working now. This site is great for us newbies to Access.Leave a comment:
-
Import Excel using a find file dialog box
I am tring to import an Excel file directly to a table in Access 2003. The code runs but it locks up the app and I need to do a ctrl/alt/del to get out. Here is the code:
Private Declare Function GetOpenFileName Lib "comdlg32.d ll" Alias _
"GetOpenFileNam eA" (pOpenfilename As OPENFILENAME) As Long
Private Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance... -
Thanks for the reply. It works but the returning record number is the wrong one I am looking for. I'am new to this and I didn't realize that each form and subform when retrieved establish their own record numbers for all the items on their respected form. The record number I want is the one that the selected item from the subform has on the main form (all items on the subform are part of the listing on the main form). I can't imagine there is anyway...Leave a comment:
-
Record Number retrieval
I have a subform that displays items that are part of a component breakdown of the item that is currently displayed on the main form. My user would like to be able to double click on an item in the subform and have the main form then populate with that items information. So the question is: Is there any way to retrieve the record number of the item in the subform so I could use the GoToRecord function? Thanks in advance. -
Thanks Rabbit, I could have sworn I tried that at least once with all the attempts at changing the statement around. I guess I couldn't see the forest because of the trees! Thanks again.Leave a comment:
-
SQL delete statement -
I'am new here so I'd like to say hello and this seems to be a great site it has already helped me a few times. I just got an assignment to correct and modify a simple access application. First some background info:. I added a delete button on a subform to remove an item from that forms list. The subfrom is populated from a table that has a primary key composed of two number fields. I have assigned varaibles to the column values for the selected row....
No activity results to display
Show More
Leave a comment: