POST
|
Awesome ! this works...Many thanks once again Xander.
... View more
01-15-2020
05:30 PM
|
1
|
1
|
1158
|
POST
|
Hi guys, Running ArcMap 10.6 and have fc's sitting in a file geodatabase. Last year I had a set of .lyr files setup with a definition query showing activity for the 'Last Month'. The definition query I used was this: (EXTRACT(MONTH FROM SEARCH_DATE) = EXTRACT(MONTH FROM CURRENT_DATE)-1) AND EXTRACT(YEAR FROM SEARCH_DATE) = EXTRACT(YEAR FROM CURRENT_DATE) This worked fine for dates January thru to December in the same year. However, opening these .lyr files in January 2020 doesn't work correctly. I basically have to re-design the query to something like this for December 2019 data: (EXTRACT(MONTH FROM LAB_DATE) = EXTRACT(MONTH FROM CURRENT_DATE)+11) AND EXTRACT(YEAR FROM LAB_DATE) = EXTRACT(YEAR FROM CURRENT_DATE)-1 But then would have to change the filter again to get January 2020 data when we move into February 2020. Is there a permanent query i can set and not have this issue for 2020 to 2021? or am i stuck with manually changing them now, then changing again in January 2021? thanks
... View more
01-14-2020
11:17 PM
|
0
|
3
|
1263
|
POST
|
thanks Josh. Yeah but my problem is that I can't use the YEAR of the START_DATE....as they are historic years. The "anniversary" occurs each year after the START_DATE and therefore I need to grab the DAY & MONTH to work this out.
... View more
10-29-2018
05:44 PM
|
0
|
1
|
14845
|
POST
|
awesome - thanks Kevin. Believe this works: (EXTRACT(MONTH FROM Start_Date) - 1) * 30 + EXTRACT(DAY FROM Start_Date) BETWEEN ((EXTRACT(MONTH FROM CURRENT_DATE) - 1) * 30 + EXTRACT(DAY FROM CURRENT_DATE)) AND ((EXTRACT(MONTH FROM CURRENT_DATE) - 1) * 30 + EXTRACT(DAY FROM CURRENT_DATE)+90) whilst not perfect ...as you say as we are assuming each month is 30 days, it's probably close enough to what I need. So this shows me records within 90 days of the current date.
... View more
10-28-2018
10:00 PM
|
0
|
3
|
14845
|
POST
|
Thanks Kevin. However my problem is to somehow use just the day and month of the Start_Date as the years are all different and are not the current year. 20/05/2016 01/01/2017 etc.. thanks, Tim
... View more
10-21-2018
08:28 PM
|
0
|
1
|
14844
|
POST
|
Thanks. But the Start Date is not the current year...it is normally 2017 and earlier so that query will not work?
... View more
10-19-2018
06:04 AM
|
0
|
0
|
14844
|
POST
|
Hi all, I have a feature class in a fgdb (ArcMap 10.6) and I want to add a definition query which shows me records that have a 'Start_Date' within 90 days of the current date. The issue I have is that the Date field (DD/MM/YYYY) I am using, I can only use the DD/MM portion of this field as the year part is not a future year date. For example: ID, Start_Date 1, 02/11/2015 2, 10/12/2001 3, 10/01/2011 Is there a way to use the day & month of the "Start_Date" field to determine if the Start_Date is within 90 days of today's date or Current Date. My filter so far is this: (EXTRACT(MONTH FROM Start_Date) >= EXTRACT(MONTH FROM CURRENT_DATE)) and (EXTRACT(MONTH FROM Start_Date) <= EXTRACT(MONTH FROM CURRENT_DATE)+3) This is using the MONTH field, and it works to a degree, but is not quite precise. It also has a problem with dates that fall in January as those records are not selected by add +3 from current month (10). Can you combine EXTRACT(DAY....) AND EXTRACT(MONTH...) in the same query? I've been trying but keep getting a syntax error. thanks
... View more
10-18-2018
11:40 PM
|
0
|
10
|
16720
|
POST
|
Hi all, I have a feature class which has 1 field which are hyperlinks to photos: e.g. [PHOTO] : C:\temp\photo1.jpg, c:\temp\photo2.jpg, c:\temp\photo3,jpg All one string in the PHOTO field, separated by commas. I want to strip out each hyperlink and update 9 Hyperlink fields in the feature class: [HYPERLINK1], [HYPERLINK2], [HYPERLINK3]….[HYPERLINK9]. I thought it would be easy going something like this: with arcpy.da.UpdateCursor(fc, ['PHOTOS', 'HYPERLINK1', 'HYPERLINK2', 'HYPERLINK3', 'HYPERLINK4', 'HYPERLINK5', 'HYPERLINK6', 'HYPERLINK7', 'HYPERLINK8', 'HYPERLINK9']) as cursor: for row in cursor: row[1] = row[0].split(",")[0] row[2] = row[0].split(",")[1] row[3] = row[0].split(",")[2] row[4] = row[0].split(",")[3] etc... cursor.updateRow(row) But I'm getting an out of index range as the [PHOTOS] field has some nulls. And also the [PHOTO] field can have between NULL and 9 Hyperlink strings separated by commas. So the above code would work if there were 9 strings separated by commas. Is there a way to get around this? ArcGIS v10.6, windows 10 Thanks
... View more
08-08-2018
12:30 AM
|
0
|
1
|
489
|
POST
|
Awesome! Thanks Xander...much appreciated. I’m sure I can work things out from here... Thanks
... View more
07-24-2018
05:29 AM
|
1
|
0
|
1722
|
POST
|
Hi all, I'm trying to compare data values in 2 separate feature classes and find out what has changed. FCnew | FIELDA (shapefile or feature class) FCmaster | FIELDA (feature class in a fgdb) FCnew is periodically being updated by external source - this can have new values or have original values removed. FCmaster is the master table I manage. This consists of the original FCnew values, and will change periodically from the FCnew. What I currently do in arcpy is join a master set of objects to FCnew attributes and then truncate FCmaster and append current records. Now I want to show what has changed as well....ideally saved to a text file. So all I want to do is compare the 2 fields (FIELDA) and print out what values are different. I've had a look at table compare etc... but find it hard to just tell me what values have changed from one field. I was thinking of building dictionaries of each set in arcpy and somehow comparing those lists? Any help would be greatly appreciated. Just put me onto the right course....! Using ArcGIS Desktop 10.6.1 Thanks
... View more
07-24-2018
02:49 AM
|
0
|
2
|
2598
|
Title | Kudos | Posted |
---|---|---|
1 | 01-15-2020 05:30 PM | |
1 | 07-24-2018 05:29 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|