Extract field if contains lowercase and date/time check

Tazlady34

Board Regular
Joined
Mar 6, 2003
Messages
56
1) If I have a field that is formatted as alphanumeric and can also have special characters...is there a way to extract that field if it contains any lowercase letters



2) Have a field in access that is date/time...how do I have it check and verify the date is the end of the month.


Thanks in advance
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
For the first one, I think that you'll need to write a function. Go to the Macros tab, click New, and paste in the following:
Code:
Function HasLowerCase(strText As String) As Boolean
    HasLowerCase = StrComp(strText, UCase(strText), vbBinaryCompare)
End Function
Then, if you want to extract the records that have lower case in a query, you can put:
HasLowerCase([fieldToCheck])
in a new query field, and in the Criteria for that field, put: True (you can uncheck the "Show" checkbox).

As to your second question, if you want to find dates that are NOT the last day of the month, you can put (again in a blank query field/column): Day([YourDateField]+1), and in the criteria for that field, put: <> 1 (if you want records that have the last day of the month in the date field, put: = 1 instead of <> 1).

The SQL for the queries might look like this (change table and field names - my table is named tbl110603, and my field names are fldText and fldDate):

1:
  • SELECT tbl110603.fldText
    FROM tbl110603
    WHERE (((HasLowerCase([fldText]))=True));
2:
  • SELECT tbl110603.fldText, tbl110603.fldDate
    FROM tbl110603
    WHERE (((Day([fldDate]+1))<>1));
Hope this helps,

Russell
 
Upvote 0

Forum statistics

Threads
1,221,574
Messages
6,160,602
Members
451,657
Latest member
Ang24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top