I need to filter the query by month and year. However, I have only been able to do it by using datpart with year. Is there a way to extract month and year from date received and filter it out for the last 3 years of records. Any other date function I have tried on date received has not worked.
Here is my sql. I hope this clairfys the issue I am having.
SELECT t_ActiveProperties.property_id, Max(AFS_dbo_v_afs_standard_data.project_afs_header_id) AS MaxOfproject_afs_header_id, AFS_dbo_v_afs_standard_data.afs_fye, Max(AFS_dbo_v_afs_standard_data.date_received) AS MaxOfdate_received...
Hello,
I have a query that I need to filter dates and return records for the last three years. I have done this by using
Year: Max(DatePart('yyyy',[date_received]))[/indent] and then filtering it by Year(Date())-3
However, I have relized this is not working because there can be to records...
Hi SkipVought,
Thanks for the help but code
ExcelSheet.Range("F17").Value= Me.[Cost] is only writing the first number of the cost column in F17 and repeating it all the way down. Would a loop next funtion help with this problem?
Thanks,
Lavender
Hello,
I am looking to export data from an access query to an excel workbook. I can do it for cell ranges using the following code:
ExcelSheet.Range("H144").FormulaR1C1 = Me.[Parts Number]
However, I need to export data into a column range and when I tried using the code below its not working...
Hello,
I am trying to return records for the last five years with out using specific dates. I have figured out how to return one year by using the formula Year(Date))). I can also return records by from 5 years using Year(Date))-5. However its only returning records for that specific year...
Hello,
I am looking for assistance with mapping multiple plot points to a google map using a URL. I know I need a function to find all of the longitude and latitude however I am not sure how to start. Any help would be appreciated. I have search articles and found open source code however...
Hello,
I am looking to plot point multiple pins in google maps using vba code. I am using this code to plot point one property using lat and long:
Private Sub Command92_Click()
On Error Resume Next
If IsNull(Me.Longitude) Or Me.Latitude = "" Then
MsgBox "No Longitude and latitude info found"...
To anwnser you questions
I assume Building_Type_ID is a string. In the query Building_Type_ID is a text field. The list box pulls its data from another table and the Building_Type_ID is the primary key.
When I created the query it return no records only the column headers and blank records.
Hi dhookom,
I get the following from the debug.print
[Building_Type_ID] = "1"Or[Building_Type_ID] = "2"
What does this mean? It is not filtering with the changes either. It is returning a blank row.
Hello,
I am having problems with my code below. It will filter the form but its returning only a blank row. I do not think it is able to filter based on my query I am not sure why it is not able to select records from my query. What am I doing wrong?
Private Sub Command1611_Click()
Dim...
Hello Andrzejek
Debug.print task returned the following:
select * from [q_Comparsion Data Form] where ( And ([Building_Type] = "3"Or[Building_Type] = "7"O))
Hello I am getting a syntax error in my code while tying to filer with a list box.
Here is my code:
Sub Search2()
Dim strSearch, strCriteria, strBuilding_Type, strCounty As String
Dim Task As String
Dim varItem As Variant
'''=========== code for Building Type List box
For Each varItem In...
Thank you for you reply I am now geting the error Runtime Error "1004" application defind or obejct-defined error when I used .ActiveSheet.Cells(1,1).PasteSpecial Format:="Tekst", Link:=False, DisplayAsIcon:=False. What could be causing it.
I am trying to export data from access to excel and tranpose the data. Combo, when I tried the .ActiveSheet.PasteSpecial Format:="Tekst", Link:=False, DisplayAsIcon:=False
However it came back with an error as well. The error was Run time error 1004 pastspecial method of worksheet class failed.
Hello,
I am trying to copy records from a form then export them to excel and transpose the data. I am getting the Runtime Error "1004" application defind or obejct-defined error. In the code that is highlight in yellow. The line is also posted here ".ActiveSheet.PasteSpecial...
Yes the code is opening the second form with the top most record. The msgbox returned id=80001 which confirms that. The id field is a unique record but are the same in both forms.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.