AI Assistant
Notifications
Clear all

MS Access Query

10 Posts
5 Users
0 Reactions
537 Views
ppm
 ppm
(@ppm)
Posts: 464
Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

I have a dateset of 1000's of projects. I am adding a new Field called Pinned. I want every Job # that contains an Asterisk to have a Yes (or True) value for the Pinned Field.?ÿ

In Design View "Select" I have it looking like this"

In Design View "Update" I have it looking like this:

But My results after I run it do not mark "Yes" (or True) by checking off the box under the Pinned Field, it looks like this after I run the query:

Here is how my SQL looks:

?ÿ

I looks like in the SQL that it is not doing any "Update to" items??

?ÿ

Help an amateur access guy out please!


 
Posted : August 27, 2021 7:30 am
bill93
(@bill93)
Posts: 9977
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

My wife says to try changing the format of the "Pinned" field to text. Let me know results.

?ÿ


 
Posted : August 27, 2021 8:22 am
ppm
 ppm
(@ppm)
Posts: 464
Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

I gave it a shot after changing the "Pinned" field to Short Text data type, and it did not run any differently. And my SQL view looks the same still.?ÿ

Thanks for the idea. I am kinda new to access and kinda not liking it.?ÿ

?ÿ


 
Posted : August 27, 2021 9:17 am
ladd-nelson
(@ladd-nelson)
Posts: 738
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
Posted by: @ppm

I have a dateset of 1000's of projects. I am adding a new Field called Pinned. I want every Job # that contains an Asterisk to have a Yes (or True) value for the Pinned Field.?ÿ

Help an amateur access guy out please!

I believe I've got this.?ÿ PM me at lnelsonATcarlsonswDOTcom and I'll give you what I believe will work.

It's too late in the evening for me to tap it out on my cell phone.


 
Posted : August 27, 2021 9:44 pm
chris87
(@chris87)
Posts: 8
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

I believe the * is a wildcard character.

So is the ?.

Try using something else.


 
Posted : August 28, 2021 4:24 am

field-dog
(@field-dog)
Posts: 1543
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

My wife is working on your problem. She's an Access pro.


 
Posted : August 28, 2021 7:04 am
field-dog
(@field-dog)
Posts: 1543
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

My wife says you can create a query that will return just the job numbers containing an asterisk without creating a pinned field. What's the purpose of the pinned field? It has been a very long time since she has worked with Access, but she's willing to help. I'll keep you updated.


 
Posted : August 28, 2021 10:22 am
ladd-nelson
(@ladd-nelson)
Posts: 738
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

If you want to select the records that have just an asterix, use the InStr() function with the Chr() function as the following:

SELECT [CLIENT DATABASE].[JOB #], [CLIENT DATABASE].PINNED
FROM [CLIENT DATABASE]
WHERE ((InStr(1,[JOB #],Chr(42))>="1"));

To update the PINNED field to True (Yes) from records in "JOB #" that contain an asterix, your query would resemble:

UPDATE [CLIENT DATABASE] SET [CLIENT DATABASE].PINNED = True
WHERE (((InStr(1,[JOB #],Chr(42)))>="1"));

To update the PINNED field to True (Yes) from records in "JOB #" that contain an asterix AND remove the asterix from the "JOB #" field, you would use the Replace() function and your query would resemble:

UPDATE [CLIENT DATABASE] SET [CLIENT DATABASE].[JOB #] = Replace([JOB #],Chr(42),""), [CLIENT DATABASE].PINNED = True
WHERE (((InStr(1,[JOB #],Chr(42)))>="1"));

In your query, you can right+click on the Query name and set the view from Design View to SQL View and paste the query string(s) above.

I hope this information helps.


 
Posted : August 29, 2021 6:33 am
ppm
 ppm
(@ppm)
Posts: 464
Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@ladd-nelson?ÿ

Thank you Ladd. I will give it a try on Monday.


 
Posted : August 29, 2021 4:50 pm
ppm
 ppm
(@ppm)
Posts: 464
Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@field-dog?ÿ

Thank you for that suggestion.?ÿ

The asterisk is there to indicate the Job number has been "Pinned" in Google Earth. I am trying to get it in a separate field so it isn't in the job number field.?ÿ

If I can first query the asterisk, and Check (or 'Yes') in the pinned field, then...?ÿ I think I know how to remove the asterisk from the job number field.

?ÿ

I will try what Ladd suggested on Monday. Thank you for assisting.?ÿ

I will post an update if I get it.


 
Posted : August 29, 2021 4:56 pm