Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8016011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:25:20+00:00 2026-06-04T20:25:20+00:00

I seem to be running into a query syntax error but cannot seem to

  • 0

I seem to be running into a query syntax error but cannot seem to isolate it. I am using MS Access and when I run the queries I get a syntax error in FROM clause.

I have two tables and they are in a one to many relationship:

Table 1 called (customer) with the following fields:

ID
FirstName

Table 2 called (tblservice) with the following fields:

serviceID
Timing
Total
customerID   <-Foreign Key

First Query:

select c.id, c.firstname, avg(s.Total) / (select count(id) from customer) as LifetimeValue
from tblservice as s join customer as c on s.id = c.id
group by s.id

Second Query(30 day span):

select c.id, c.firstname, avg(s.Total) / (select count(id) from customer) as LifetimeValue
from tblservice as s join customer as c on s.id = c.id
where (s.Timing)>=DateAdd("d",-30,Date())
group by s.id
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:25:22+00:00Added an answer on June 4, 2026 at 8:25 pm

    Try this:

    select c.id, c.firstname, avg(s.Total) / count(c.id) as LifetimeValue
    from tblservice as s inner join customer as c on s.id = c.id
    group by c.id, c.firstname
    

    and

    select c.id, c.firstname, avg(s.Total) / count(c.id) as LifetimeValue
    from tblservice as s inner join customer as c on s.id = c.id
    where (s.Timing)>=DateAdd("d",-30,Date())
    group by c.id, c.firstname
    

    You cannot select c.id and c.firstname unless you group by them. And you can use count(c.id) since you are already grouping by c.id. I have not used SQL in MS Access though. So I am not 100% sure. Try it out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get prettyPhoto to work, but I seem to be running into
I'm running into a problem that I can't seem to get past. Whenever I
I am running a simple DATEDIFF query but it doesn't seem to calculate the
Seem to run into a service endpoint not found problem when trying to get
I'm trying to write an xml parser but seem to be running into some
This may seem like a silly title but I'm running into a small problem
I seem to be running into a documentation drought with CURL vs FTP, can
I am running into a problem that just doesn't seem right. I've got a
I'm running JBoss as a windows service, but i can't seem to find where
I'm trying out java and I seem to be running into some problems. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.