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 9009093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:06:14+00:00 2026-06-16T02:06:14+00:00

I have database dbadmin , table – tbl_empreimburse with fields-emp_id,rem_amount,rem_date . I want to

  • 0

I have database dbadmin, table – tbl_empreimburse with fields-emp_id,rem_amount,rem_date.

I want to retrieve data which comes from given date to a week back.
I tried this query,

SELECT SUM(rem_amount),DATEADD(dd, -7, "2012-01-10")  
FROM tbl_empreimburse 
GROUP BY emp_id 
HAVING emp_id='5' AND rem_date BETWEEN DATEADD(dd, -7, "2012-01-10") AND "2012-01-10"

It gives me error “FUNCTION dbadmin.DATEADD does not exist“. Do I need to convert “2012-01-10” to date format? Any Help, Please?

  • 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-16T02:06:15+00:00Added an answer on June 16, 2026 at 2:06 am

    Check this *SQLFIDDLE reference out. 🙂

    I am not sure why you are using group by clause here…

    Sample date:

    ID  AMOUNT  RDATE
    1   3400    January, 01 2012 00:00:00+0000
    2   5000    January, 10 2012 00:00:00+0000
    3   3000    January, 02 2012 00:00:00+0000
    5   1000    January, 05 2012 00:00:00+0000
    5   2000    January, 04 2012 00:00:00+0000
    2   2000    February, 10 2012 00:00:00+0000
    

    Query:

    select * from emp
    where id = 5;
    

    here is the query to get sum

    select id, sum(amount)
    from emp
    where rdate between '2012-01-10' - interval 7 day
    and '2012-01-10'
    and id = 5
    ;
    

    Results:
    all records by employee id = 5

    ID  AMOUNT  RDATE
    5   1000    January, 05 2012 00:00:00+0000
    5   2000    January, 04 2012 00:00:00+0000
    

    sum of amount by employee id = 5

    ID  SUM(AMOUNT)
    5   3000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have database table with few text fields which i use to filter data
I have database in which data is imported from the other table. if data
I have database table with the follwoing fields: id, loan_no, installment, status which has
I have database table but without the index, and I want to add index
I have database table. As I further saw that the data was in a
I have database in the MyApp.app/Contents/Resources folder. I want at least to read data
I have database table with following fields FieldId FieldGroupId FieldName I need to select
i have database from which i get data to my C# app using SQL
I have database with time data. I want to interpolate the data to mach
i have database with two values id and val so i want to ask

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.