Converting HELP!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working on a query that shows the average time an employee has worked at
the company i have already completed the DateDiff string, some of my results
however came out with "0" as the results, I need to know how to convert
everything that is "0" and make it "1"
 
If your SQL look like that

Select DateDiff("d",[StartDate],[End Date]) As DifferentInDays From TableName

Then you can use the DifferentInDays as a field and iif to replace the 0
with 1

Select DateDiff("d",[StartDate],[End Date]) As DifferentInDays,
iif([DifferentInDays]=0,1,[DifferentInDays]) As NewDifferentInDays From
TableName
 
I am working on a query that shows the average time an employee has worked at
the company i have already completed the DateDiff string, some of my results
however came out with "0" as the results, I need to know how to convert
everything that is "0" and make it "1"

Please post the SQL view of the query, and explain what you want. Do
you want everyone who's worked there for one day to show up as having
worked there for a year, together with people who've worked there 729
days?

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top