Excel Concatenate month - excel-2007

I am trying to take the following value and making it into a date format of dd-MMM-yy
For example: 110412 turns into 04-NOV-12
My formula as of right now is:
(CONCATENATE(MID(E14,3,2),"-",(TEXT(LEFT(E14,2),"MMM")),"-",RIGHT(E14,2)))
It is giving me 04-Jan-12.
Please note that I would like the month to be in all caps.

Try using the "UPPER(foo)" function as a wrapper to make the result all caps.
UPPER((CONCATENATE(MID(E14,3,2),"-",(TEXT(LEFT(E14,2),"MMM")),"-",RIGHT(E14,2))))
or better still:
=MID(E14,3,2)&"-"&UPPER(TEXT(DATE(MID(E14,5,2),MID(E14,1,2),MID(E14,3,2)),"MMM"))&"-"&RIGHT(E14,2)

Related

How do I get the right date format after using get text on the folder date?

I have tried everything that I can think of to get the right date format. Can anybody help with this RPA-problem in UiPath. I have used the 'get text' activity to get the folder date and after that tried to use the
Datetime.ParseExact(Str variable,"dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).
It gives me the error:
Assign: String was not recognized as a valid DateTime.
Your help is much appreciated.
edit: I have now sought help from a friend who figured it out. The error was in the string, which could not be seen, because there was an invisible character in the string that I extracted through 'get text' activity. The solution is in 2 steps:
assign another variable to the exact same date and use an if statement to find out if these two strings are equal and you will find out that they are not.
Now use a regex to capture only digits and slash/hyphen which will get rid of the invisible character.
Try to use "dd_MM_yyyy" instead of "dd/MM/yyyy".
The reason is because UiPath/VB.Net has a habit of using US date formatting even though you're using Culture Info...It's a real pain
Try this:
pDateString = "21/02/2020"
Assign a Date type variable = Date.ParseExact(pDateString,"dd/MM/yyyy",nothing)
Here we're telling the parser to use English format date...The Date type returned will be in US format but you can simply convert back to uk IF needed by using something like:
pDateString("dd/MM/yyyy")

Adding a zero to my month function

I want to use the today() function as a dynamic filter to show MM/YYYY as number format
So i want my filter to show =201601
But with my function i get 20161: input(CATS(Year(TODAY()),Month(TODAY())), 6.) =20161
Does anybody know how to show 201601 instead of 20161?
There is a format that will display a data in YYYYMM format.
put(today(),yymmn6.)
Did you intend to convert to a number instead of a character string? If so then you could use the INPUT function as in your example.
input(put(today(),yymmn6.),6.)
You could even use the YYMMDDN format if YYMMN doesn't work for you, just read the first 6 digits.
input(put(today(),yymmddn8.),6.)
Or you could build the number arithmetically.
year(today())*100+month(today())
Here's the proper function:
put(today(), yymmn6.)

Change sql Get date to format ccmmdd?

I am trying to find out how to change my get date into the format of ccmmdd?
So far the closest iv come is ccyymmdd with:
CONVERT(VARCHAR(8),GETDATE(),112)
This produces 20140505, What i'm looking for is 140505.
Is there a link i can follow to see the different sql date formats, or would this be best done through string manipulation?
Try this:
CONVERT(VARCHAR(8),GETDATE(),12)
The list of available formats can be found here:
http://msdn.microsoft.com/en-us/library/ms187928.aspx
This also works.
RIGHT(CONVERT(VARCHAR(10),GETDATE(),112),6)

Format date in Visual basic

I would like to get today's date in the following format: mmddyyyy.
Even if it's first of August I still want zeros in front, like so: 08012012.
I think I can use DatePart function for it, but I am not sure how.
Anyone has an idea?
Thanks.
You do not say which application, but in VBA, you can say:
Format(date(),"mmddyyyy")
Application.Text(Date(),"mmddyyyy")
Format(NOW,"mmddyyyy")
NOW gives time as well:
Format(NOW,"hh:mm:ss")

Format date like M/D/Y

I got a date of the type SYDATUM and wondering how to format it in a format like m/d/y.
I've found some snippets on the web, but they were not really helpful.
-thanks yor your help.
You should be more specific - what exactly do you want to do with the date (use type D internally, it's shorter and does the same thing).
Do you want to WRITE it to a list screen? Use the formatting options described in the documentation and online help:
WRITE l_my_date MM/DD/YYYY.
Do you want to convert it to a text variable? Very similar:
WRITE l_my_date TO l_my_text MM/DD/YYYY.
To set the date format in a SAPscript form, see the SET DATE MASK command.
To print the formatted date in a SmartForm, use the WRITE command and a temporary variable (yes, ugly, I know...)
Most controls (ALV Grid for example) should take care of the format automatically.
However - be careful when hard-coding the format into your application. Usually you don't have to do this because the system automatically uses the format specified in the user master data. This ensures that every user will see the date formatted according to their locale settings.
Normally it's better to export the date into the plant level country specific date format:
if w_country is initial.
select single LAND1
from T001W
into w_country
where WERKS eq w_the_plant.
endif.
SET COUNTRY w_country.
write w_the_date to w_export.
for example 03/04/2002 could be different date in different country.
You can try the keyword TRANSLATE. Alternatively suggest you could have a look at this link