I am using an application (Qxpress) that I believe uses VB or Access as their Database.
I would like my invoice to return just the day of the month but if date falls between 1 and 9 I would like to add a zero to it.
this is what i currently have
mid ('{subreport1.jobdate},(4),(2))

if the actual jobdate is 10/05/2005 I get 5/ as the result
if I print the date I actually get 10/5/2005 which is missing the 0
How can I obtain that first number after the /.

someone suggested for me to use the following formula

DatePart('d','{subreport1.jobdate}')


the 'd' looks for the day of the month in a date field. That could be 'm' for month, or 'y' for year, I think.


This give me the same result that I obtained when I use my formulas. I still get 1 digit if the day of the month is less than 9. I always want to have 2 digits return when I request the day of the month or when i am trimming but if the day falls between 1 and 9 I only receive 1 digit. I am still looking to obtain 2.

I am trying to add an IF statement but since i want my answer to look as follows it is important for me to obtain the date

customer#-mmddyy
mmddyy is the day the job was performed (hence jobdate)
so for a customer with a customer ID = 87 for which a service was provide to him on August 09 2005

i want to get the 08 for the month, 09 for the day and 05 for the year

87-080905

That's all i need

Thanks

Recommended Answers

All 2 Replies

Try:

format(DatePart('d','{subreport1.jobdate}'),"00")

Thanks, that really works.

Try:

format(DatePart('d','{subreport1.jobdate}'),"00")

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.