954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

format(date,"YYYY") error can't find project or library

good day all..
While I am compiling a vb6 project, the error highlighted this:
format(date,"YYYYMM")

Can anyone help me? Thank u very much..

acidking001
Newbie Poster
13 posts since Mar 2010
Reputation Points: 16
Solved Threads: 1
 

Sorry the title is wrong, not "YYYY" but "YYYYMM" and i'm using Windows 7.. Thanx for your help..

acidking001
Newbie Poster
13 posts since Mar 2010
Reputation Points: 16
Solved Threads: 1
 

you have to compile in this modality
format(now mm/yyyy)
or
label1 = format(now yyyy)
label2 = format(now mm)
label3 = label1 + label2
I that this could be the soluction
good work

Coco Chanel
Newbie Poster
7 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

FORMAT is a function, so you have to set some variable equal to it. So, for example:

Dim myVar As String
myVar = Format(Date, "YYYYMM")

Should work fine. At least, it did when I ran it. Hope that helps.

BitBlt
Master Poster
711 posts since Feb 2011
Reputation Points: 367
Solved Threads: 109
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: