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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:37:10+00:00 2026-06-15T21:37:10+00:00

I have looked high and low for this particular query and have not seen

  • 0

I have looked high and low for this particular query and have not seen it.

We have two tables; Accounts table and then Visit table. I want to return the complete list of account names and fill in the corresponding fields with either null or the correct year etc. this data is used in a matrix report in SSRS.

sample:

Acounts:
AccountName  AccountGroup  Location
Brown Jug    Brown Group   Auckland
Top Shop     Top Group     Wellington
Super Shop   Super Group   Christchurch

Visit:
AcccountName  VisitDate   VisitAction
Brown Jug     12/12/2012  complete
Super Shop    1/10/2012   complete

I need to select weekly visits and show those that have had a complete visit and then the accounts that did not have a visit.

e.g.
Year  Week  AccountName  VisitStatus       for week 10/12/2012 should show
2012    50  Brown Jug    complete
2012    50  Top Group    not complete
2012    50  Super Shop   not complete

e.g.
Year  Week  AccountName  VisitStatus      for week 1/10/2012 should show
2012     2  Brown Jug    not complete
2012     2  Top Group    not complete
2012     2  Super Shop   complete
  • 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-15T21:37:12+00:00Added an answer on June 15, 2026 at 9:37 pm

    please correct me if am worng

    select to_char(v.visitdate,’YYYY’) year,

    to_char(v.visitdate,’WW’) WEAK,a.accountname,v.visitaction

    from accounts a,visit v

    where a.accountname=v.ACCCOUNTNAME

    and to_char(v.visitdate,’WW’)=to_char(sysdate,’WW’)

    union all

    select to_char(sysdate,’YYYY’) year,

    to_char(sysdate,’WW’) WEAK,a.accountname,’In Complete’

    from accounts a

    where a.accountname not in ( select v.ACCCOUNTNAME

    from visit v where to_char(v.visitdate,’WW’)=to_char(sysdate,’WW’));

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

Sidebar

Related Questions

I have looked for the answer to this high and low but cannot get
I have looked high and low and can't seem to find this anywhere. Does
I've looked high and low for an answer to this and I'm hoping someone
Looked high and low for this one but can't find my answer. I am
I have looked into this fairly extensively, but have not found quite what I
I have looked high and low for a solution and I have found many
This may seem like a silly question, but I've looked high and low for
Have looked quite hard for this answer but having no luck. I have 3
I have looked at questions like this , this , this and this ,
I have looked around on Google and StackOverflow for the answer to this question,

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.