Grafana works on Explore but not on Panels

Hello people!

I’m facing one issue that i can’t understand how to solve it!

I cant display any data in panels, however, if i try the exact same query on the explore menu, i can get everything properly!

I have the latest version of grafana (8.5.0).
My data Source - SQL Server Express

Here are some prints!



Just a new information:

When I try a Bar gauge, i Get this error. (My dateAndTime variable its in DataTime2 Format).

What data type is DateAndTime?

Hello yosiasz

Its DateTime2(7)

So in the source database in the actual table it is data type DateTime2(7)
Is it mysql, sql server or ?
Could you provide some sample data as follows

create table #sample(dateAndTime DateTime2(7), tk1_lt int)

insert into #sample
values('2022-01-02T13:33:44',23)

and we could try it on our side. Actually that error message is interesting it says db has not time column :slight_smile: I would think it should say table or data source. How could it know the whole db has no time column

Its SQL Server V2014

1 Like

Here it is…

Zero series returned… =(

I cant import image data into my sql server :). please provide proper DDL and DML

--DDL
create table #sample(dateAndTime DateTime2(7), tk1_lt int)

--DML
insert into #sample
values('2022-01-02T13:33:44',23)

1 Like

–DDL
CREATE TABLE TestTable (
DateAndtime DateTime2(7)
,Tk1_Lt Int
);

–DML

  insert into TestTable (DateAndTime, Tk1_Lt) values('2022-01-02T13:33:44',23)
  insert into TestTable (DateAndTime, Tk1_Lt) values('2022-01-02T13:43:45',24)
1 Like

works for me. make sure your date filter matches the data range you have. the sample value you provided is 2022-01-02 so your date filter/span should be cover those dates

image

Also if you are going to do the timeGroup make sure to alias it with as time

$__timeGroup(DateAndtime,"1s") as time,

Yes… It Works that Sample… but not my data Table (float Type)

Works for me with float. using this data

drop table spocas;

CREATE TABLE spocas (
DateAndtime DateTime2(7)
,Tk1_Lt float
);
  insert into spocas 
  select distinct  top 100000  
  dateadd(dd, a.column_id, getdate()) as DateAndtime , 
cast(b.column_id * .10 as float) 
  from sys.all_columns a 
  cross apply sys.all_columns b
  select * from spocas