How do you format a Date to a string as YYYYMMDD?

How do you format a Date to a string as YYYYMMDD?

  
How do you format a Date variable to a text string as YYYYMMDD.  I must contain all 8 digits.  i.e, if the date is 09-02-2014, it must be formatted as 20140902 and not 201492.  DateToText gives me MM-DD-YYYY.  Help!
Hi.

Try standard FormatShortDate() function. The second parameter is the separator so FormatShortDate(YourDate,"") will return YYYYMMDD. No separators.