Date to String in VB.Net MS Access 2013 -


I have a field in the table that contains dates and strings like 04Jan_lole . I want to generate this field in Visual Basic,

date + "_" + thename

me unmatched error I try to convert the date part into a string:

StrField = theDate.ToString ("ddMMM")

Let me < Em> invalid qualifier returns error .

What should I do to create this format: 04Jan_lole ? Seeing that! If I want to define the date as a datetime then gives me an error Automation type is not supported by Visual Basic.

This is not clear from your question why it is that you invalid Qualifications error are probably because you are trying to use VB.NET syntax in VBA? However, if you are actually using VB.NET, then the following code should work for you:

  Public function formatData and name (date as date, in the form of a string Name) return as a string. Trostring ("ddMMMM") & amp;  

Then, you can call it like this:

New date (2004, 1, 1) "Date_lole" dim dateAndName string = format date and name (myDate, myName) console in string = VBA (instead of VB.NET). The light line (dateAndName) 'output' 04Jan_lole " < P> You must be able to use it like this:

  public function formatting as the name and date (date as the date, string in the form of strings) Format format date and name = format (date, "ddMMMM") & amp;  

and then you can call it like this:

  less As result, string result = formatting and name (# 1/1/2004 #, "_lole") MsgBox (results)  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -